home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 016a / get25.zip / GET.DOC < prev    next >
Text File  |  1991-11-29  |  165KB  |  3,527 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.                                    GET.EXE
  10.  
  11.  
  12.  
  13.  
  14.                         Bob Stephan's BATch Enhancer
  15.  
  16.  
  17.  
  18.  
  19.                                  Version 2.5
  20.  
  21.                                 November 1991
  22.  
  23.  
  24.  
  25.                          Copyright 1991, Bob Stephan
  26.                              All Rights Reserved
  27.  
  28.  
  29.                      For information or orders contact:
  30.  
  31.  
  32.                                   MOBY DISK
  33.  
  34.  
  35.                                    Phone:
  36.                                 1-408-646-1899
  37.                                 1-408-646-1373
  38.                                GENIE: MOBYDISK
  39.                            COMPUSERVE: 72357,2276
  40.                  Bob Stephan on CRICKET BBS: 1-408-373-3773
  41.  
  42.  
  43.                        Monterey Bay Disk Data Systems
  44.                               Attn: Bob Stephan
  45.                             1021 San Carlos Road
  46.                            Pebble Beach, CA 93953
  47.  
  48.  
  49.   GET.DOC              GET Version 2.5              Copyright 1991 Bob Stephan
  50.  
  51.   READ.ME
  52.  
  53.     GET.EXE is a general purpose DOS BATch file enhancer.  It makes informa- 
  54.       tion available to the BATch file through the BATch IF subcommand.  The 
  55.       information can come from user input or from the operating system, and 
  56.       it is made available to the BATch file through the DOS ErrorLevel (Exit 
  57.       Code) and variables in the DOS master Environment. GET also has capabil- 
  58.       ities to set some system parameters and perform a few other specific ac- 
  59.       tions, over 30 functions in all.  Not only is GET wonderful for automat- 
  60.       ing your personal system, it is excellent for client support and soft- 
  61.       ware installation programs.  If you have been using an older version of 
  62.       GET, you will also be interested in the information in GET25NEW.DOC to 
  63.       help focus on the new and improved features.
  64.  
  65.     LICENSING SUMMARY
  66.  
  67.     GET is copyrighted software and is not in the public domain!  GET is not 
  68.       totally free for all users, and there are conditions imposed on its dis- 
  69.       tribution.  Please read this information and the section on Licensing 
  70.       and Distribution to be sure you are not using GET illegally.  The only 
  71.       version of GET that is free is the one that displays the help screen 
  72.       when the name GET is entered at the DOS prompt by itself.  If you have 
  73.       one that says it is licensed and you have not registered, you have a 
  74.       pirated copy that is protected by law.
  75.  
  76.     VENDORS, CORPORATE, and COMMERCIAL users see licensing terms under Licens- 
  77.       ing and Distribution.
  78.  
  79.     INDIVIDUALS, SHAREWARE AUTHORS, and SYSOPS.  For individuals this version 
  80.       of GET is free for personal use, and for the use of shareware authors in 
  81.       distributing their products subject to the conditions specified in the 
  82.       Licensing and Distribution terms below.  GET.EXE may be freely copied 
  83.       and distributed provided that all files in the GET package, including 
  84.       but not limited to GET.DOC and GET25NEW.DOC, are included on the disk or 
  85.       in the compressed file with GET.EXE.  Contributions to support this de- 
  86.       velopment project will be gratefully accepted.  If you use GET and can't 
  87.       send money, at least send thanks.  Programmers do not live by bread 
  88.       alone.  Besides, I'll put you on the list to help me distribute new 
  89.       releases as they become available.
  90.  
  91.     If you send $15 or more (overseas $20 U.S. funds) you will receive the 
  92.       following benefits: (California residents please add 7.75% sales tax.)
  93.       The latest version of GET with any new features plus one free upgrade.
  94.       A smaller runtime version to distribute with your BATch files.
  95.       A single user license with no royalties for use of the runtime version.
  96.       A >60 page user manual giving examples and detailed explanations.
  97.       Free support by BBS, mail, phone, CompuServe, or Genie (see below).
  98.       Notification of new releases and upgrades after the first one.
  99.  
  100.     If you have a modem, VISA and MASTERCARD registrations can be entered via 
  101.       NITELOG BBS, 408-655-1096.  After completing the brief sign-on registra- 
  102.       tion, enter S for Script, then 3 for Script 3.
  103.  
  104.     If you have any questions, comments, or suggestions please contact me at:
  105.           MOBY DISK: 1021 San Carlos Road, Pebble Beach, CA 93953
  106.       Phone: (408) 646-1899/1373.    GENIE:MOBYDISK.    COMPUSERVE:72357,2276
  107.       BBS: The Cricket 408-373-3773        /s/ Bob Stephan   November 29, 1991
  108.  
  109.  
  110.   GET.DOC                       Table of Contents                      Page ii
  111.  
  112.  
  113.                                Table of Contents
  114.  
  115.   READ.ME....................................................................i
  116.   LICENSING SUMMARY..........................................................i
  117.     Vendors, Corporate, and Commercial Users.................................i
  118.     Individuals, Shareware Authors, and SYSOPS...............................i
  119.   VISA and MASTERCARD........................................................i
  120.   SYSTEM REQUIREMENTS........................................................1
  121.   ACKNOWLEDGMENTS............................................................1
  122.   ABOUT THE AUTHOR...........................................................2
  123.   LIMITED WARRANTY (and other legalities)....................................2
  124.   HELP SCREEN................................................................3
  125.   ENTERING COMMANDS..........................................................5
  126.   SEE HOW IT RUNS............................................................5
  127.   SYNTAX EXPLANATIONS........................................................6
  128.     Command..................................................................6
  129.     Argument(s)..............................................................6
  130.       [] brackets............................................................6
  131.       "" double quotes.......................................................6
  132.       filespec...............................................................6
  133.       chars..................................................................6
  134.       #......................................................................6
  135.       num, div...............................................................6
  136.     Environment..............................................................6
  137.     ErrorLevel...............................................................7
  138.     Extended.................................................................7
  139.     Surrogates...............................................................7
  140.     Switches.................................................................7
  141.   ERRORLEVEL.................................................................8
  142.   SWITCHES..................................................................10
  143.     /A...........................Prompt Attribute...........................10
  144.     /B.........................Flush Keyboard Buffer........................11
  145.     /C..........................Suppress Ctrl-Break.........................11
  146.     /E.............................Enhanced Keys............................11
  147.     /L...............................Lowercase..............................11
  148.     /M..........................Master Environment..........................11
  149.     /TR..............................Trim Right.............................11
  150.     /TL..............................Trim Left..............................11
  151.     /U...............................Uppercase..............................12
  152.     /V.............................Variable Name............................12
  153.     /W............................Wait or Number............................12
  154.     /X....................Extended Keys or eXtra function...................12
  155.     /~..........................GET S Escape Action.........................13
  156.   USING GET COMMANDS........................................................14
  157.   STRING HANDLING AND SCREEN I/O............................................14
  158.     GET C...........................GET Character...........................18
  159.     GET N.........................GET yes/no aNswer.........................21
  160.     GET T............................Moving Text............................23
  161.     GET S.............................GET String............................25
  162.     GET I..........................Check Key Buffer.........................28
  163.     GET Z..........................Put String (Zap).........................30
  164.     GET ZE..........................Standard Input..........................32
  165.     GET R.............................'Rithmetic............................34
  166.     GET B........................Clear (Blank) Screen.......................36
  167.     GET V.........................Get/set video mode........................37
  168.     GET VE.......................Get/set video border.......................38
  169.     GET H...........................Date and Time...........................39
  170.     GET U..........................Keyboard BUffer..........................42
  171.  
  172.   Page iii                      Table of Contents                      GET.DOC
  173.  
  174.     GET UE............................Shift Locks...........................44
  175.   GET DISK and FILE Information.............................................45
  176.     GET K........................Get disk free space........................45
  177.     GET Q.....................Get Disk Capacity (Quota).....................47
  178.     GET L..........................Get volume label.........................49
  179.     GET LE........................Match volume label........................51
  180.     GET F...........................Get file size...........................52
  181.     GET Y.........................Current Directory.........................56
  182.     GET YE...........................Logged Drive...........................56
  183.   GET MEMORY and SYSTEM Information.........................................58
  184.     GET BR........................Get/Set Break Flag........................58
  185.     GET P.......................Check for Printer(PRN)......................59
  186.     GET PE......................Initialize Printer(PRN).....................59
  187.     GET E........................Get Environment Left.......................60
  188.     GET M..........................Get Memory Free..........................61
  189.     GET D..........................Get DOS Version..........................62
  190.     GET 7.........................Check Coprocessor.........................63
  191.     GET 7E..........................Check CPU Type..........................63
  192.     GET 4.........................Check 4DOS Status.........................64
  193.     GET 4E.......................Check Windows Status.......................64
  194.     GET A.........................Check for ANSI.SYS........................65
  195.     GET AE.....................Check for ROM BIOS Model.....................65
  196.     GET W...........................Warm/Cold Boot..........................66
  197.   Environment and Shells....................................................67
  198.   PROGRAM INFORMATION.......................................................68
  199.   LICENSING AND DISTRIBUTION................................................68
  200.     Corporate Users.........................................................68
  201.     SYSOPs, User Groups, and Shareware authors..............................69
  202.     Vendors.................................................................69
  203.     Registered Users........................................................69
  204.   Now for the commercial....................................................69
  205.   SPECIAL OFFER.............................................................70
  206.   Appendix A.......................The DOS Environment.....................A-1
  207.   Appendix B.......................ASCII and Scan Codes....................B-1
  208.   GET.DOC                          INTRODUCTION                         Page 1
  209.  
  210.     INTRODUCTION
  211.  
  212.     BATch programming can make your computing life easier.  BATch programming 
  213.       with GET can make your BATch programming much easier and more produc- 
  214.       tive.  Most versions of DOS do not support a wide variety of useful fea- 
  215.       tures in the BATch programming commands that are available.  GET supple- 
  216.       ments these commands, and gives BATch the capabilities it needs to real- 
  217.       ly do a proper job as a macro language.
  218.  
  219.     GET provides additional commands in four general areas:
  220.  
  221.            String Handling and Screen I/O Commands
  222.            Disk and File Commands
  223.            Memory and System Commands
  224.  
  225.     The commands are fully described herein, along with some general informa- 
  226.       tion on BATch programming and the use of ErrorLevel and the DOS Environ- 
  227.       ment.  However, this is not a BATch programming tutorial or primer. 
  228.       Many useful books and publications can give you startup help if you need 
  229.       it.  Among those that I am familiar with are "MS-DOS Batch File Program- 
  230.       ming" by Ronny Richardson, Windcrest, 2nd Ed. 1990, and "DOS Power 
  231.       Tools" mentioned below.
  232.  
  233.     SYSTEM REQUIREMENTS
  234.  
  235.     GET is compatible with all computers running under DR, MS or PC-DOS Ver- 
  236.       sions 2.0 and later, although 3.1 or later is preferred.  It requires 
  237.       only about 11K of memory and is stored on disk in a smaller compressed 
  238.       format.  It is not memory resident (TSR) and will not reduce the amount 
  239.       of memory available to other programs.  It supports all types of 
  240.       monitors and display adapters whether monochrome or color.
  241.  
  242.     To support the many features of GET it is preferable if you are running 
  243.       DOS 3.1 or later.  A few of the features may not work on earlier ver- 
  244.       sions, or with some of the early XT and AT ROM BIOS's.  Where these 
  245.       limitations are known, they are mentioned in this document.
  246.  
  247.     ACKNOWLEDGMENTS
  248.  
  249.       My thanks to members of MBUG-PC, The Monterey Bay Users' Group - Per- 
  250.       sonal Computer, for their indulgence during my development of this sys- 
  251.       tem.  Many members have used preliminary versions and offered their com- 
  252.       ments and suggestions.  I am particularly grateful to the beta testers 
  253.       who held my feet to the fire to ensure that this would be a reliable and 
  254.       useful product.  Among those in MBUG-PC who have been particularly help- 
  255.       ful are (in alphabetical order) Fred Brownell, Fred Huddle, Lee Keely, 
  256.       Jim Robeson, and Luther Schliesser.  Others who have been very helpful 
  257.       are Kevin Paddock and Steve Ferg.  I am also grateful to Bantam Computer 
  258.       Books for including GET in the Revised Second Edition of "DOS Power 
  259.       Tools," and Ronny Richardson for including it in his book mentioned 
  260.       above.
  261.  
  262.  
  263.  
  264.   Page 2                          INTRODUCTION                         GET.DOC
  265.  
  266.     ABOUT THE AUTHOR
  267.  
  268.     Bob Stephan has been using and programming computers for over 25 years, 
  269.       mostly for other companies and for his own use and enjoyment.  Shareware 
  270.       is his first independent commercial venture (see the commercial at the 
  271.       end of this document).  He has been a mainstay in his local computer 
  272.       users group for over 8 years and is a past president as well as an au- 
  273.       thor of informative articles for the newsletter, leader of special in- 
  274.       terest groups, and provider of help to members on a variety of topics.
  275.  
  276.     LIMITED WARRANTY (and other legalities)
  277.  
  278.     Bob Stephan warrants the physical diskette and physical documentation pro- 
  279.       vided with the registered version to be free of defects in materials and 
  280.       workmanship for a period of sixty days from the purchase date.  The 
  281.       entire and exclusive liability and remedy for breach of this Limited 
  282.       Warranty shall be limited to replacement of the defective diskette or 
  283.       documentation and shall not include or extend to any claim for or right 
  284.       to recover any other damages, including but not limited to loss of prof- 
  285.       it, data, or use of the software, or special, incidental, or consequen- 
  286.       tial damages or other similar claims.  In no event will any liability 
  287.       for damages ever exceed the registration fee actually paid for the li- 
  288.       cense to use the software, regardless of any form of the claim.  Bob 
  289.       Stephan specifically disclaims all other warranties, express or implied, 
  290.       including but not limited to, any implied warranty of merchantability or 
  291.       fitness for a particular purpose.
  292.  
  293.     Be that as it may, I claim that this software will perform substantially 
  294.       as detailed in this documentation when used on a machine with compatible 
  295.       software (DOS) and compatible firmware (ROM BIOS).  If it does not work 
  296.       as documented when used in conformance with this documentation, I will 
  297.       either fix it if it is broken or refund your registration fee.  If you 
  298.       are not satisfied, return the original registered disk and documentation 
  299.       within 30 days for a full refund of the registration fee paid.
  300.  
  301.     DR DOS, MS DOS, and 4DOS are trademarks of their respective companies.
  302.  
  303.  
  304.  
  305.   GET.DOC                          HELP SCREEN                          Page 3
  306.  
  307.     HELP SCREEN
  308.  
  309.     If you enter GET at the DOS prompt by itself, or with any invalid argument 
  310.       such as a question mark, it will display the following summary of all 
  311.       GET commands:
  312.  
  313. ╔══════════════════════════════════════════════════════════════════════════════╗
  314. ║ GET Version 2.5   -   BATch File Enhancer   -   Copyright 1991 Bob Stephan   ║
  315. ║  Syntax:  GET command argument(s) /switches     More Instructions: GET.DOC   ║
  316. ║Purpose             Command   Argument(s)   Environment  ErrorLevel  Extended ║
  317. ║---------           -------   -----------   --(GET=)---  --(Exit)--  --[E]--- ║
  318. ║          --------- String Handling and Screen I/O Commands --------          ║
  319. ║Get character(InKey)C[E] ["prompt"][chars]   Character   ASCII code  No Echo  ║
  320. ║Get yes/no aNswer   N[E] ["prompt"][seconds] Character   ASCII code  No Echo  ║
  321. ║Get string          S[E] ["prompt"][pattern] String      Length      No Echo  ║
  322. ║Put string (Zap)    Z[E] ["string/prompt"]   String      Length      StdInput ║
  323. ║Moving Text(GetaKey)T[E] "filespec" [chars]  Character   ASCII code  No Echo  ║
  324. ║Key check (IsKey)   I[E]                     Char.Waitng Char.Waitng Get Char ║
  325. ║Date and Time       H[E] 1=DoW 2=DoM 4=Mon 8=Yr 16=Hr 32=Min 64=Sec  Sum/Cat  ║
  326. ║Keyboard BUffer     U[E] ["chars"][num][/Wnum]  --       Length      Caps/Num ║
  327. ║'Rithmetic (add)    R[E]  [num] [/Wnum]      Sum/Diff    Sum/Diff    Subtract ║
  328. ║Clear (Blank) Screen  B[E] [New attribute]      Old attribute        HexAttr  ║
  329. ║Video mode/VGA border V[E] [New mode/color]     Old mode/color      VGA Border║
  330. ║          --------- Disk and File Commands --------                           ║
  331. ║Get file size (DIR=0)  F[E] filespec[/WdivXA]Bytes/Hex   Kilobytes   Kb/10    ║
  332. ║Get disk free space    K[E] [drive] [/Wdiv]  Kilobytes   Kb/10       Kb/100   ║
  333. ║Get disk capacity      Q[E] [drive] [/Wdiv]  Kilobytes   Kb/10       Kb/100   ║
  334. ║Get volume label       L[E] ["label"][drive] Label       1=yes,0=no  Match    ║
  335. ║Get current directory  Y[E] [drive for Y]    Directory   Level/Drive Drive:A=0║
  336. ║          --------- Memory and System Commands --------                       ║
  337. ║Get Environment left   E[E]                  Bytes left  Bytes left  Bytes/10 ║
  338. ║Get memory free        M[E]                  Kilobytes   Kilobytes   Kb/10    ║
  339. ║Get/Set Break Flag     BR   [New flag 1=on, 0=off]   Old flag        None     ║
  340. ║Check for printer(PRN) P[E]                  1=yes,0=no  1=yes,0=no Initialize║
  341. ║Check 4DOS/Windows     4[E]                  1=yes,0=no  1=yes,0=no  Windows  ║
  342. ║Get DOS version        D[E]                  Major Vers. MajorMinor  MinorEnv ║
  343. ║Check coprocessor/CPU  7[E]                  1=yes,0=no  1=yes,0=no  CPU Type ║
  344. ║Check ANSI.SYS/Model   A[E]                  1=yes,0=no  1=yes,0=no  PC Model ║
  345. ║Warm/Cold Boot         W[E] If argument given then 1=warm, 0=cold    ColdBoot ║
  346. ║ Surrogates: }=Carriage Return, ~=Escape, Alt-255=Space/Blank.                ║
  347. ║ SWITCHES: /C Ctrl-Break, /U /L case, /M Master Env, /E Enhanced keys, /Vvar= ║
  348. ║  /X eXtended keys/Hex, /A[nnn] prompt Attribute, /W[nnnn] Wait seconds/div   ║
  349. ║  /B flush key Buffer, /TL /TR Trim, /~ Escape action for GET S, /V- No var   ║
  350. ║ See GET.DOC for additional features and BATch programming instructions.      ║
  351. ╚══════════════════════════════════════════════════════════════════════════════╝
  352.  
  353.     Displaying the help screen by simply entering GET will now pause at the 
  354.       end of the second screen with the message
  355.  
  356.       Press PgUp to repeat the first screen - Esc, CR, or space bar to exit
  357.  
  358.     Pressing PgUp at this point will start the help screen display over again. 
  359.       Pressing CR (Enter or Return on the keyboard) will exit and clear the 
  360.       screen giving you a clear screen to work on.  Pressing Esc or the space 
  361.       bar will exit and leave the second help screen on the display for 
  362.       reference.  The pause will time out in 10 seconds and return to the DOS 
  363.       prompt automatically.
  364.  
  365.  
  366.  
  367.   GET.DOC                          HELP SCREEN                          Page 4
  368.  
  369.     You can make a file copy of this Help Screen by using DOS redirection. 
  370.       Enter the command GET >GET.HLP.  When you see the --More-- prompt, press 
  371.       Enter again.  This Help Screen will be in the file GET.HLP.  When you 
  372.       are BATch programming, put the help file in one of your editor's windows 
  373.       where you can use it for quick reference.
  374.  
  375.  
  376.  
  377.   GET.DOC                       ENTERING COMMANDS                       Page 5
  378.  
  379.     ENTERING COMMANDS
  380.  
  381.     GET is used in BATch files.  When you want to use GET in a BATch file use 
  382.       the following simple procedure:
  383.  
  384.     1. Enter the word GET as the first entry on a line, followed by a space.
  385.  
  386.     2. Tell GET what it is that you want it to get for you.  Do this by selec- 
  387.       ting and entering a one or two letter command from the Command column on 
  388.       the HELP SCREEN.  All of the commands are described in this document.
  389.  
  390.     3. If there are arguments, enter a space and then the arguments that you 
  391.       need or want to run the command.
  392.  
  393.     4. If you want to use any of the /switches, enter them on the same line 
  394.       after all argument(s).
  395.  
  396.     5. On the next line of the BATch file, check the return from GET in the 
  397.       ErrorLevel and/or the GET= variable in the Environment.  The Environment 
  398.       variable can be accessed as %GET% or by the name you give it with the /V 
  399.       switch described below.
  400.  
  401.     For example, to get a yes or no answer you might enter the lines:
  402.  
  403.          :Ask
  404.          GET N "Answer yes or no: "
  405.          IF "%GET%"=="N" goto NO
  406.          IF "%GET%"=="Y" goto YES
  407.          Rem The next line checks to see if the user pressed Escape
  408.          if ErrorLevel 126 goto END
  409.          ECHO You must enter Y or N, or press Esc to exit.
  410.          goto ASK
  411.          :NO
  412.          Rem [Do what you need to do if the user enters N]
  413.          goto END
  414.          :YES
  415.          Rem [Do what you need to do if the user enters Y]
  416.          :END The next line clears GET out of the Environment.
  417.          set GET=
  418.  
  419.     SEE HOW IT RUNS
  420.  
  421.     The best way to find out how GET works is to just try it.  You can try it 
  422.       from the command line by using the special built-in reporting feature. 
  423.       To see what GET is putting in the ErrorLevel and the Environment, issue 
  424.       the DOS command SET GET?=ON.  This will tell GET to report the results 
  425.       to the screen in addition to placing them in the ErrorLevel and the En- 
  426.       vironment.  Then run the GET commands that you want to check out, or run 
  427.       your BATch file to see what GET reports.
  428.  
  429.     You can also try GET from the command line if you use SET (by itself) to 
  430.       check what has been placed in the Environment, but to find out what is 
  431.       in the ErrorLevel, you must use a BATch file unless you SET GET?=ON.  If 
  432.       you are not familiar with the DOS Environment, see the discussion of En- 
  433.       vironment and Shells elsewhere in this documentation.
  434.  
  435.  
  436.   Page 6                       ENTERING COMMANDS                       GET.DOC
  437.  
  438.   SYNTAX EXPLANATIONS (Refer to the HELP SCREEN)
  439.  
  440.     Command: Commands are one or two character combinations as shown on the 
  441.       HELP SCREEN.  Single character commands can [optionally] be immediately 
  442.       followed by E with no spaces between.  The E indicates the Extended 
  443.       function in the last column on the HELP SCREEN.
  444.  
  445.     Argument(s):  Arguments are zero, one, or two character strings as ap- 
  446.       propriate to the command.  A "string" is a sequence of consecutive ASCII 
  447.       characters delimited by double quotes or, if not in quotes, by the space 
  448.       character.  In some cases the first, or only, argument must be enclosed 
  449.       in double quotes as shown on the HELP SCREEN.  Arguments that are not 
  450.       shown in quotes on the HELP SCREEN must not be put in quotes.  Each 
  451.       character string can consist of zero or more ASCII characters.  The 
  452.       blank or space character (ASCII 32) delimits the character strings that 
  453.       are not in quotes.  The space character can only be a member of one of 
  454.       the strings that is enclosed in double quotes.  (In this document, both 
  455.       "blank" and "space" are used as synonyms for the ASCII-32 character.)
  456.  
  457.       [] brackets indicate optional portions of commands and/or arguments. The 
  458.         command will work regardless whether these portions are included or 
  459.         not.  The brackets themselves must not be included!
  460.  
  461.       "  Where double quotes ("'s) are shown, they must be included if the 
  462.         corresponding prompt, string, or filespec argument is used.
  463.  
  464.       filespecs consist of a filename and extension as appropriate to the DOS 
  465.         file naming conventions.  They may include drive and path but no wild- 
  466.         cards in the general form of d:\path\filename.ext.
  467.  
  468.       chars refers to an ASCII character string which can include any of the 
  469.         ASCII characters from decimal 33 to decimal 255 inclusive, but some of 
  470.         these characters have special significance.  Blanks can only be used 
  471.         in  strings that must be enclosed in double quotes (but see the use of 
  472.         surrogates below.)  IMPORTANT: All characters in the chars argument 
  473.         must be in a contiguous string with no blanks, including any surrogate 
  474.         characters!  If you want to specify the space character use the Alt- 
  475.         255 surrogate.
  476.  
  477.       # is now obsolete.  Although it is still supported in Version 2.5 for 
  478.         compatibility, it must be replaced with the /W syntax because # will 
  479.         not be supported in future versions. The new and preferred method is 
  480.         to use the /W switch.  Note that because of this special significance, 
  481.         # cannot be used as an input character in the chars string.
  482.  
  483.       num and div must be entered as ASCII decimal digit characters represent- 
  484.         ing a number containing no more than 4 digits.  The new preferred 
  485.         syntax is to use the /W switch to enter numbers where the old syntax 
  486.         was #num or #div.
  487.  
  488.     Environment: this column indicates what will be found in the Environment 
  489.       string GET= or the one you name with the /V switch.  This string can be 
  490.       accessed from a BATch file with the %GET% notation. It is best to en- 
  491.       close %GET% in double quote characters in case it is empty.  For exam- 
  492.       ple:
  493.          IF "%GET%"==""
  494.       will check for an empty GET variable.  The variable name can be changed 
  495.       with the /V switch described below.  If you need more information on 
  496.       testing Environment variables, see the section on Environment and Shells 
  497.       later in this document.
  498.  
  499.  
  500.   GET.DOC                       ENTERING COMMANDS                       Page 7
  501.  
  502.  
  503.     ErrorLevel: this column indicates what value will be placed in the DOS Er- 
  504.       rorLevel where it can be accessed in BATch files with the "IF Error- 
  505.       Level" subcommand.  Always check for ErrorLevel from highest to lowest 
  506.       values of interest. ErrorLevel is also referred to as Exit Code or 
  507.       Return Code.  If you need more information on testing the ErrorLevel, 
  508.       see the next section on ERRORLEVEL.
  509.  
  510.     Extended: this column indicates the action taken if the optional E for 
  511.       [E]xtended command is included.  Do not include the brackets! In most 
  512.       cases E applies to either the result in the Environment or the result in 
  513.       the ErrorLevel, but not to both.  In a few cases the E invokes a sepa- 
  514.       rate but loosely related function.
  515.  
  516.     Surrogates:  Some characters are awkward or impossible to handle directly 
  517.       in BATch files.  For example, BATch files generally use the carriage 
  518.       return <CR> and space characters as delimiters instead of as ASCII 
  519.       characters that can be manipulated.  Some special symbols have been 
  520.       designated to facilitate the handling of these characters.  These sub- 
  521.       stitutions may have different meanings depending on the command being 
  522.       used, so read the description of the command.  The special characters 
  523.       are:
  524.            Carriage Return: } is used for CR
  525.            Escape:          ~ is used for Esc
  526.            Blank:     Alt-255 is used for Space (Blank).
  527.  
  528.       The Alt-255 character can be entered in most text editors by holding 
  529.       down the Alt key while spelling out the digits for the character on the 
  530.       number pad of the keyboard, but check your text editor for this capabil- 
  531.       ity.
  532.  
  533.       It is often convenient to ask the user to press the space bar.  The 
  534.       blank (or space) surrogate, Alt-255, makes it possible to check for a 
  535.       space.  In most versions of DOS the subcommand IF "%GET%"==" ", or any 
  536.       comparison of strings which include spaces, does not work properly since 
  537.       DOS uses the space as a delimiter.  By using Alt-255 as a surrogate for 
  538.       the space character, WYSIWYG is maintained, and the character can be 
  539.       manipulated like any alphabetic character.  4DOS, however, treats 
  540.       strings in double quotes properly.
  541.  
  542.     Switches are special modifiers to GET commands.  A switch is indicated by 
  543.       the forward slash character, "/", immediately followed by the ap- 
  544.       propriate letter or character.  See SWITCHES, page 10.
  545.  
  546.  
  547.  
  548.   Page 8                        The Error Level                        GET.DOC
  549.  
  550.   ERRORLEVEL
  551.  
  552.   If you are not familiar with testing for the ErrorLevel in BATch files, read 
  553.     this section.  If the ErrorLevel holds no mysteries for you, then skip to 
  554.     the next section.  To test a program to determine what ErrorLevel(s) it 
  555.     returns, use RUN.EXE included in GET25.ZIP.  See RUN.DOC for details.
  556.  
  557.   Most modern programs that run under DOS issue a numeric status code which is 
  558.     passed back to DOS when they terminate.  This is variously referred to as 
  559.     a "return code", "exit code", "status code", "error code", "Error Level", 
  560.     etc.. An "ErrorLevel" is simply that code, whatever it may be called. 
  561.     Generally, an errorlevel of 0 means a normal, successful completion, and a 
  562.     non-zero return code indicates a problem of some sort.  GET uses the Er- 
  563.     rorLevel for different purposes to pass information back to the BATch file 
  564.     in such a way that the BATch file can make use of it with the IF ERROR- 
  565.     LEVEL subcommand.
  566.  
  567.   IF ERRORLEVEL is one of the cases of the IF statement.  It tests the return 
  568.     code from the program for some condition that you specify.  The various IF 
  569.     tests always result in a true/false result - either the test is true or it 
  570.     is false.  If it is true, the statement following the IF test on the same 
  571.     line is executed, otherwise it is ignored.  The IF ERRORLEVEL test is al- 
  572.     ways a "greater than or equal" test, or in BASIC parlance >=.  So when you 
  573.     enter IF ERRORLEVEL 5 DO SOMETHING, it means "if the return code from the 
  574.     previous program is greater than or equal to 5" the BATch file is to do 
  575.     something, otherwise it will ignore the rest of the line starting with IF.
  576.  
  577.   To test specifically for an ErrorLevel of 0 you use the NOT parameter for 
  578.     the IF subcommand.  So when you enter IF NOT ERRORLEVEL 1 DO SOMETHING 
  579.     ELSE, it means "if the return code is not greater than or equal to 1 do 
  580.     something else."  Since return codes can only be integers 0 through 255, a 
  581.     return code that is not >= 1, can only be 0, hence the test for Error- 
  582.     Level=0.
  583.  
  584.   ERRORLEVEL tests can be "and"ed to test for a specific return code.  If you 
  585.     enter IF ERRORLEVEL 5 IF NOT ERRORLEVEL 6 DO STILL ANOTHER THING, it means 
  586.     "if the return code is greater than or equal to 5 but not greater than or 
  587.     equal to 6 do still another thing."  The only integer that satisfies those 
  588.     conditions is 5 itself.
  589.  
  590.   Not all programs return error levels.  DOS itself is the worst offender.  No 
  591.     internal commands that I know of return codes, and not all the external 
  592.     commands are so thoughtful.  Later versions of DOS are getting better 
  593.     about returning and documenting such codes, but unless it is documented 
  594.     that a code is returned and what it signifies, there is no way to assume 
  595.     that one is available.  To find out what a return code means you must read 
  596.     the documentation for the program or command.
  597.  
  598.   If there is a possibility of several return codes, the IF ERRORLEVEL tests 
  599.     must be used in descending order because of the >= meaning.  For example, 
  600.     the MS DOS 5.0 FORMAT command is documented to have the following "exit 
  601.     codes."
  602.  
  603.       0  The format operation was successful.
  604.  
  605.       3  The user pressed Ctrl-C to stop the process.
  606.  
  607.       4  A fatal error occurred (any error other than 0, 3, or 5).
  608.  
  609.  
  610.   GET.DOC                        The Error Level                        Page 9
  611.  
  612.  
  613.       5  The user pressed N in response to the prompt "Proceed with 
  614.     Format(Y/N)?" to stop the process
  615.  
  616.     You can set up a BATch file to automate the FORMATTING process, then check 
  617.     to see if it was successful.  A portion of your BATch file might look like 
  618.     this:
  619.  
  620.   :AGAIN
  621.   FORMAT %1 %2 %3
  622.   if ErrorLevel 5 goto DONE
  623.   if ErrorLevel 4 goto ERROR
  624.   if ErrorLevel 3 goto ASK
  625.   Rem If it wasn't one of the above, it has to be 0,
  626.   Rem so go back to see if you want to do it again.
  627.   goto AGAIN
  628.   :ERROR Come here if a fatal error occurred - code=4.
  629.   ECHO The FORMAT command failed!
  630.   :ASK Come here if the ErrorLevel was 3 - user pressed Ctrl-C
  631.   GET N "Do you want to try another disk?"
  632.   if "%GET%"=="Y" goto AGAIN
  633.   :DONE
  634.   Echo The FORMAT operation has been completed!
  635.   Echo Have a good day.
  636.  
  637.  
  638.   Page 10                           SWITCHES                           GET.DOC
  639.  
  640.   SWITCHES
  641.  
  642.   Switches are special modifiers to GET commands.  A switch is indicated by 
  643.     the forward slash character, "/", immediately followed by the appropriate 
  644.     letter or character.  More than one switch may be used with a command, and 
  645.     all switches must come after any other arguments.  Switches that are not 
  646.     applicable to a command will be ignored and not cause any harm if in- 
  647.     advertently included.  Some switches replace the "surrogate" character 
  648.     syntax that was used in GET Version 2.2 and earlier.  The old syntax has 
  649.     been retained in Version 2.5 for compatibility, but will be eliminated in 
  650.     future versions.  Where the switches duplicate other features, the switch 
  651.     is the preferred method.  The switches that have been implemented in 
  652.     Release 2.5 are /A, /B, /C, /E, /L, /M, /TR, /TL, /U, /V, and /W.
  653.  
  654.   /A lets you control the screen attribute of prompts.  The prompts can be 
  655.     displayed in reverse video, or any of 254 color combinations that are 
  656.     available on color monitors.  /A by itself causes the prompt to be dis- 
  657.     played in reverse video.  /Annn, where nnn is a number between 1 and 254 
  658.     specifies the attribute to be used for the prompt.  The following table 
  659.     explains how to construct the attribute.  It is not necessary to have 
  660.     ANSI.SYS or any of its clones loaded to display prompts with attributes.
  661.  
  662.           The color codes are:
  663.              0 Black         2 Green      4 Red          6 Brown
  664.              1 Blue          3 Cyan       5 Magenta      7 White
  665.  
  666.           For the foreground color for the characters:
  667.              1. Select the color number from the above table.
  668.              2. For high intensity (bright or light), add 8.
  669.              3. For Blinking, add 128.
  670.           Example:
  671.              Blinking, high-intensity magenta is 5+8+128=141
  672.  
  673.           For the background color:
  674.              1. Select the color number from the above table.
  675.              2. Multiply it by 16.
  676.              3. Add it to the foreground color.
  677.     Example:
  678.     Blinking, high-intensity magenta on white is 141+(7*16)=253
  679.     GET C "This is in blinking, high-intensity, magenta on white " /A253
  680.  
  681.     With some command processors (4DOS is one), there can be a minor problem 
  682.     if the user presses break when the prompt is displayed on the bottom line 
  683.     of the screen if using GET ZE for input.  If you are using GET ZE for in- 
  684.     put, you probably don't want to use /A to specify an attribute for the 
  685.     prompt.  This will prevent the prompt color from being taken by DOS as the 
  686.     new color to use for scrolling the screen if the user presses a break key.
  687.  
  688.     As mentioned above, you can use /A to echo text to the screen in color. 
  689.     Any of the commands that display a prompt can do it if you specify 0 sec- 
  690.     onds to wait.  GET I does not wait anyway, and it will display a prompt if 
  691.     there is one specified, so it is a good choice to use for the Echo command 
  692.     because you do not have to remember to specify /W0.
  693.  
  694.     In Version 2.5, if the /A switch is not included, the prompt will be dis- 
  695.     played in such a manner that ANSI sequences can be used for screen con- 
  696.     trol.  This restores compatibility with Version 2.2 for prompting and 
  697.     using ANSI screen control sequences.  The "prompt" will always be sent to  
  698.  
  699.  
  700.   GET.DOC                           SWITCHES                           Page 11
  701.  
  702.     the screen even if standard output is redirected with DOS redirection (>). 
  703.     Without /A the prompt can be as long as will fit on the DOS command or 
  704.     BATch line which is limited to 128 characters total.  With /A, the prompt 
  705.     is limited to 79 characters.
  706.  
  707.   /B flush keyboard Buffer.  Useful to flush any type-ahead keystrokes when 
  708.     asking for user input.
  709.  
  710.   /C tells GET to handle Ctrl-C and Ctrl-Break instead of letting DOS do it. 
  711.     It has the same effect as the old Alt-253 which has been retained for com- 
  712.     patibility.  The switch is preferred.  See the GET USER INPUT section for 
  713.     additional details.
  714.      Example: GET SE "Enter your password: " /C.
  715.   Caution: The old Alt-253 surrogate will be eliminated in future versions.
  716.  
  717.   /E specifies that keystrokes will be read from the Enhanced keyboard.  This 
  718.     has the same effect as the old surrogate for the enhanced keyboard, Alt- 
  719.     254, which has been retained for compatibility in this version.  /E only 
  720.     affects the C, N, I, and T commands.  Also, note the discussion of the 
  721.     handling of the extended and enhanced keys by using scan codes and upper 
  722.     ASCII characters.
  723.       Example: GET C "Enter F11 to continue: " Θ /E
  724.   Caution: The old enhanced surrogate will be eliminated in future versions.
  725.  
  726.   NOTE: Extended keys are those with no ASCII representation, such as the 
  727.     function and cursor keys.  Enhanced keys are keys on the enhanced keyboard 
  728.     which do not appear on older keyboard layouts, such as F11 and F12.
  729.  
  730.   /L specifies that the string that is written to the Environment is to be 
  731.     forced into lower case.  Any ASCII-255 characters will be "lowercased" to 
  732.     the ASCII space character.  Strings with spaces in them will not test 
  733.     properly with the BATch IF subcommand.  Also: see /U for Uppercase.
  734.      Example: GET SE "Enter your password: "  /C /L
  735.  
  736.   /M tells GET to try to put the string in the master environment instead of 
  737.     the child environment.  If the BATch file is being run from a secondary 
  738.     shell, GET will bypass the environment of the secondary command processor 
  739.     and look for the master environment.  This works exactly like the old GET 
  740.     Z, and it makes GET Z more flexible.  Without /M, GET Z will put the 
  741.     quoted string into the first command processor environment that it finds. 
  742.     If you want GET Z to work like it did in Version 2.2, you must add the /M 
  743.     switch.  The advantage is that /M can be used with any GET command.  If 
  744.     you need more information about the different environment areas see the 
  745.     section on ENVIRONMENT AND SHELLS.
  746.       Example: GET Z "Put this string in the master environment" /M
  747.  
  748.   Caution: Finding the master environment is not a documented feature of DOS, 
  749.     and there is no guarantee that /M will work under all conditions.  For ex- 
  750.     ample, don't expect it to work if the command processor is running in a 
  751.     DESQview window or under Windows, and it may cause the system to hang.  If 
  752.     you need this capability, be sure to test it under all possible conditions 
  753.     before relying on it.
  754.  
  755.   /TR and /TL trim blanks from the string that is written to the environment. 
  756.     Trim works with S, SE, Z, ZE, and HE.  /TR or /T+ will trim blanks from 
  757.     the right or trailing end of the string, while /TL or /T- will trim blanks 
  758.     from the left or leading end of the string.  Both switches may be used in 
  759.     the same command if desired.
  760.  
  761.  
  762.   Page 12                           SWITCHES                           GET.DOC
  763.  
  764.  
  765.   /U specifies that the string that is written to the Environment is to be 
  766.     forced into upper case (Caps).  Any spaces will be "uppercased" to ASCII 
  767.     255 so that the string can be tested with the BATch IF subcommand.  /U is 
  768.     not necessary with the C, N, I, or T commands.  Also: see /L for Lower- 
  769.     case.
  770.      Example: GET SE "Enter your password: "  /C /U
  771.  
  772.   /Vvar= lets you specify a name for the Environment variable to be used in 
  773.     place of "GET".  This can eliminate some BATch file lines that would be 
  774.     used to save the GET variable under another name with the SET command. 
  775.     The name must be contiguous with the V in /V and should be terminated with 
  776.     the = sign.  Although the '=' sign is optional, the name must be 
  777.     terminated in some way, and the '=' sign is the recommended method.  How- 
  778.     ever, any one of the following characters will serve as the terminating 
  779.     delimiter for the name: =, space, /, or carriage return (indicating the 
  780.     end of the command line or BATch file line).  Lowercase letters will be 
  781.     coerced to uppercase before placing the name in the Environment.  The fol- 
  782.     lowing example will establish an Environment variable that will show up as 
  783.     DEMO= instead of the default name GET=.
  784.       Example (old method): GET C "Enter the drive letter: " ABCD
  785.                             set DEMO=%GET%
  786.       Example (new method): GET C "Enter the drive letter: " ABCD /vdemo=
  787.  
  788.   CAUTION:  If you modify BATch files to take advantage of the convenience of 
  789.     the /V switch, be sure you adjust all references to the %GET% variable in 
  790.     subsequent statements to reflect the new variable name.
  791.  
  792.   /V- completely suppresses creating the Environment variable under any name. 
  793.     No changes to the Environment will be made.  This is useful when the 
  794.     result is of no interest, or when all the information required can be ob- 
  795.     tained from the ErrorLevel.  This may be useful at times when there is in- 
  796.     sufficient free space in the Environment, or when there is reluctance to 
  797.     create an Environment variable which might overwrite one that is already 
  798.     there.
  799.  
  800.   NOTE: A side effect of /V- is that SET GET?=ON will have no effect.  Since 
  801.     the search of the Environment is being completely bypassed, GET cannot 
  802.     check for the GET? variable.
  803.  
  804.   /W has different meanings for different commands.  In general it is always 
  805.     used to input a number for use by the command.  When getting user keyboard 
  806.     input, /W is used to specify a number of seconds to wait.  In other com- 
  807.     mands the number has other meanings and uses.  See the description of the 
  808.     command for further details.
  809.  
  810.     NOTE: /Wnnnn is a general replacement for the old #nnnn notation.  /W can 
  811.     and should be used wherever the # notation was previously valid.  The # 
  812.     notation will disappear in future versions.
  813.  
  814.   /X provides eXtra functionality for a command.  It has different meanings 
  815.     depending on the command being used.  When getting keyboard input, /X 
  816.     specifies that extended keys will be accepted. /X also is used to specify 
  817.     hexadecimal output for the GET F (file size) command, and for other pur- 
  818.     poses with other commands.  See GET F or the specific command for further 
  819.     details.
  820.  
  821.  
  822.  
  823.   GET.DOC                           SWITCHES                           Page 13
  824.  
  825.   /~ is a temporary switch that is used with GET S only.  Previously, if the 
  826.     user pressed Esc when you asked for a string, GET S would return 0 as if 
  827.     the user had not entered anything (i.e., just pressed Return).  A more 
  828.     useful feature that has been suggested is for GET S to return the Environ- 
  829.     ment and ErrorLevel codes for the Escape surrogate.  That way the program- 
  830.     mer can determine whether the user entered nothing or Escaped. The /~ 
  831.     switch, when used with GET S, will turn on this new feature.
  832.  
  833.  
  834.  
  835.   Page 14                        Get User Input                        GET.DOC
  836.  
  837.   USING GET COMMANDS
  838.  
  839.   The description of GET commands is subdivided into the following sections of 
  840.     this manual.
  841.  
  842.       String Handling and Screen I/O
  843.       DISK and FILE Information
  844.       MEMORY and SYSTEM Information
  845.  
  846.   STRING HANDLING AND SCREEN I/O
  847.  
  848.   The commands C, N, S, Z, T, I, H, U, R, B, and V pertain to obtaining key- 
  849.     board input from the user, moving and modifying text strings, and getting 
  850.     and setting screen attributes.  These commands take 0, 1, or 2 arguments 
  851.     as shown on the HELP SCREEN, and can make use of many of the switches.
  852.  
  853.     "prompt"  refers to an arbitrary character string that will be displayed 
  854.       on the screen to coach the user as to what type of input is expected. If 
  855.       a prompt is used, it must be enclosed in double quotes.  Prompts can be 
  856.       displayed in reverse video or in color with the /A switch.
  857.  
  858.     NOTE: The "prompt" can be used to issue ANSI.SYS screen control escape se- 
  859.       quences.  It is more convenient to use GET to do this, than to make 
  860.       changes to the DOS PROMPT and have to reset PROMPT, especially if the 
  861.       BATch file is going to be run on various computer systems that may use 
  862.       different prompts.  Do not use /A when you want ANSI.SYS or one of its 
  863.       clones to see the prompt.  If any form of /A is specified, GET uses a 
  864.       different method of displaying the prompt which bypasses ANSI.SYS.  Note 
  865.       also, that when /A is used, the maximum length of the prompt is 79 
  866.       characters.  Longer prompts will be truncated to 79 characters.  Without 
  867.       /A the prompt can be longer, limited only by the maximum length of a 
  868.       BATch file line which in most versions of DOS is 128 characters.
  869.  
  870.     pattern is a special case of chars in which certain characters have spe- 
  871.       cial meanings.  See the S command for detailed information.
  872.  
  873.     chars -- also see char information above -- are ASCII character strings 
  874.       which cannot include the space character, but may include surrogates. If 
  875.       any chars are given, user input will be limited to the characters in the 
  876.       character string including those indicated by the surrogates. If no 
  877.       chars are given, any key stroke will be accepted. To indicate that a 
  878.       carriage return, Esc, or space is acceptable, include the surrogate 
  879.       character listed above.  CR and Esc will return 125 and 126 in the Er- 
  880.       rorLevel respectively, and the surrogate character in the Environment. 
  881.       Space will return 255 and Alt-255 if the characters are converted to up- 
  882.       percase.  Uppercase is automatic with C, N, I, and T, or when the /U 
  883.       switch is used.  It can be defeated with the /L switch.  Think of ASCII 
  884.       255 as an upper-case Space for purposes of GET input.
  885.  
  886.     Switches:
  887.  
  888.     /E specifies that Enhanced keyboard keys will be accepted. If you use /E, 
  889.       the BIOS function for the enhanced keyboard will be used.  This permits 
  890.       the recognition of F11 and F12 as well as other enhanced and extended 
  891.       keyboard keys.  /E should not be used unless you are sure that all users 
  892.       of your BATch file will be using enhanced keyboards because it absolute- 
  893.       ly does not work on machines with older BIOS's that do not recognize the 
  894.       enhanced keyboard interrupt.
  895.  
  896.  
  897.   GET.DOC                        Get User Input                        Page 15
  898.  
  899.  
  900.     /X specifies that extended keys will be accepted. This has the same effect 
  901.       as the old surrogate for extended keys, "{", which has been retained 
  902.       (but see below) for compatibility.  /X is used in the same manner as /E, 
  903.       but will not recognize F11, F12 or other enhanced keys.
  904.         Example: GET C "Enter F1 to continue: " ƒ /X
  905.  
  906.       If extended or enhanced keyboard characters are specified with /X or /E 
  907.       (you don't need both) the scan code plus 100 will be in the ErrorLevel 
  908.       and the corresponding upper ASCII character in the Environment.  A table 
  909.       of keyboard scan codes is included in the file SCANCODE.DOC.
  910.  
  911.       The extended and enhanced scan codes are mapped to the upper ASCII table 
  912.       by adding 100 to the scan code.  For example, the scan code for F1 is 
  913.       59.  If extended keys are allowed, the upper ASCII character 159, "ƒ", 
  914.       will limit extended keystrokes to just the F1 key.  Scan codes of 28 
  915.       through 150 are recognized as the upper ASCII surrogates 128 through 
  916.       250.  A table of scan and ASCII codes is included in the file SCAN- 
  917.       CODE.DOC with the registered version.  One method of entering the upper 
  918.       ASCII characters is by using the Alt-NumPad feature of DOS.
  919.  
  920.       There are some caveats that go along with this extended key scheme.
  921.  
  922.        1. If you want extended and/or enhanced keys to be recognized, you must 
  923.           include either the old surrogate or the new switch for those keys. 
  924.           The switch is the preferred method as the surrogate will be discon- 
  925.           tinued in a future version.  The upper ASCII characters will not be 
  926.           recognized as surrogates for the extended keys unless the switch or 
  927.           the surrogate is included.
  928.  
  929.        2. If you use the old surrogate, it must come after all individual key 
  930.           specifications (if any) including the surrogates for CR and Esc.
  931.  
  932.        3. If you specify any individual keys at all, then you must specify all 
  933.           keys that you want to allow.  The following will not do what appears 
  934.           to be intended:
  935.               GET C "Press x or any function key: "  x /X
  936.           In this example, only the X key will be accepted even though the /X 
  937.           switch is included.  A better example is:
  938.               GET C "Press x or F1: "  xƒ /X
  939.           or equivalently but not preferred:
  940.               GET C "Press x or F1: "  xƒ{
  941.  
  942.        4. Also note that the mapping of extended keys for GET U is not the 
  943.           same as for GET C.
  944.  
  945.     /C Break: The /C switch will suppress DOS Control-C and Ctrl-Break hand- 
  946.       ling.  It applies only to the S, C, and N commands.  Ctrl-Break handling 
  947.       works a bit differently according to whether you have specified a wait- 
  948.       ing time or not.  If no timeout has been specified, Ctrl-Break will just 
  949.       cause a beep.  If a timeout has been specified, and the first keystroke 
  950.       is Ctrl-Break, then GET will simulate a timeout with an ErrorLevel of 0, 
  951.       the same ErrorLevel you would check for to see if there was a timeout. 
  952.       If any character is entered, the timeout is cancelled, and Ctrl-Break is 
  953.       handled as if there is no timeout.  For single character input, Ctrl-C 
  954.       will return the value and character 3 <''> if all characters are al- 
  955.       lowed (no chars string), or a beep if specific chars are specified. 
  956.       This provides versatility in break handling, but some experimentation 
  957.       would be a good idea to become familiar with the methods.
  958.  
  959.  
  960.   Page 16                        Get User Input                        GET.DOC
  961.  
  962.  
  963.     /W[nnnn] The number nnnn following /W will be used to establish the number 
  964.       of seconds to wait for the first key stroke to be entered.  If timeout 
  965.       takes place with nothing entered, the ErrorLevel will be 0, and there 
  966.       will be no GET variable in the Environment.  If /W is omitted, GET will 
  967.       wait forever.  If a wrong key is pressed the timeout is cancelled.
  968.         Example: GET C "Answer Yes or No: " YN /W20
  969.       will wait 20 seconds for a character to be entered.  If none are entered 
  970.       in that time, GET will exit with 0.  If a wrong character (not Y or N) 
  971.       is entered, GET will wait until a correct character is entered regard- 
  972.       less of the time. The default if /W is omitted is interpreted to mean 
  973.       wait forever.
  974.  
  975.     NOTE: /W has the same effect as the old #num syntax, which is retained in 
  976.       this version for compatibility.
  977.         Example(old method): GET C "Enter F1 to continue: " ƒ#20 /X
  978.         Example(new method): GET C "Enter F1 to continue: " ƒ /X /W20
  979.       Caution, the old #nnn syntax will be eliminated in future versions.
  980.  
  981.     /W0 or /W with no number indicates no wait.  The prompt will be displayed, 
  982.       and GET will immediately exit with ErrorLevel 0.  This is useful to 
  983.       "echo" text in reverse video or in color with the /A switch.  If a 
  984.       character is ready in the keyboard buffer due to a type-ahead, GET C, T, 
  985.       and N will read that character.  If it was a valid character for the 
  986.       command, it will be reported as a valid character for the command.
  987.  
  988.     /L will convert any uppercase Environment characters to lowercase.  For 
  989.       get C, T, and N, the ErrorLevel will still represent the ASCII code for 
  990.       the uppercase character, and the Echo, if any, will be the uppercase 
  991.       character.
  992.  
  993.     General: The C, N, I, and S commands read characters using a BIOS call so 
  994.       they bypass Standard Input and most keyboard redefinition methods (mac- 
  995.       ros).  The old "surrogate" methods for Ctrl-Break, Extended, and En- 
  996.       hanced keys are supported in Release 2.5 for compatibility, but will not 
  997.       be supported in future versions.
  998.  
  999.       IMPORTANT: Please remember that the special ASCII characters '<', '>', 
  1000.       and '|' are DOS redirection characters and you cannot use them as 
  1001.       characters in BATch files.  4DOS also uses '^' and the grave accent 
  1002.       (back quote) as special characters so they should not be used unless you 
  1003.       know that no users of your BATch file will be running 4DOS or NDOS in- 
  1004.       stead of COMMAND.COM.  Single keystrokes for C, N or T are acted on 
  1005.       without pressing Enter. (String input, of course, will require the user 
  1006.       to press Enter.)
  1007.  
  1008.       When a character is entered by the user in response to C, N, or T, it is 
  1009.       compared with the list of valid chars (if any).  This validation of 
  1010.       characters is not case sensitive.  That is, if the user enters a lower- 
  1011.       case letter it will be converted to uppercase and the chars will also be 
  1012.       converted to uppercase if necessary before any validation comparisons 
  1013.       are made.
  1014.  
  1015.       When checking for string matching with the MS DOS BATch IF subcommand, 
  1016.       remember that it is case sensitive. Different versions of DOS handle
  1017.         IF "string1"=="string2"
  1018.  
  1019.  
  1020.   GET.DOC                        Get User Input                        Page 17
  1021.  
  1022.       somewhat differently, and there have been several "bugs" reported in one 
  1023.       version or another.  Try to test any such constructs under several DOS 
  1024.       versions including DR DOS and 4DOS/NDOS if possible.  In some versions 
  1025.       the string cannot contain any spaces.  The test under 4DOS is not case 
  1026.       sensitive, and it can contain spaces if the strings are enclosed in dou- 
  1027.       ble quotation marks.  Only 4DOS does it right.
  1028.  
  1029.  
  1030.   Page 18                          GET Character                         GET C
  1031.  
  1032.     GET C                                                        Get Character
  1033.  
  1034.     Syntax: GET C[E] ["prompt"] [chars] [/switches]
  1035.     Input:  "prompt" to be displayed.
  1036.             chars to specify the acceptable characters that can be entered.
  1037.             /switches - /A /W /C /M /E /X /V /L
  1038.     Output: ErrorLevel - ASCII or surrogate scan code.
  1039.             Environment - character
  1040.  
  1041.     C is short for "Character".  GET C obtains a single character from the 
  1042.       user and does not wait for a carriage return <CR> to be pressed.  As 
  1043.       soon as the user presses a key, GET immediately evaluates the key that 
  1044.       was pressed. The keystroke will be echoed to the screen to provide the 
  1045.       user with feedback on the key that was pressed. If the keystroke is an 
  1046.       alphabetic character (letter) it will be converted to uppercase if 
  1047.       necessary, although the echo will be the actual letter typed in by the 
  1048.       user.  The storage of the letter in uppercase can be reversed with the 
  1049.       /L switch for lowercase.
  1050.  
  1051.     GET CE is a special case in which the character is not echoed to the 
  1052.       screen.  This might be useful if the character represents a password or 
  1053.       other secret symbol that must be held confidential and hidden from the 
  1054.       eyes of casual observers, or if the character entered has no special 
  1055.       significance as with the PAUSE command.
  1056.  
  1057.     In its simplest form, GET C, no prompt is issued and any keystroke except 
  1058.       extended keys will be accepted.  The BATch file will simply pause until 
  1059.       a key is pressed.  However, the user should be given some indication of 
  1060.       what is expected, and the prompt provides a convenient means to do so. 
  1061.       For example, you can emulate the DOS PAUSE subcommand with the following 
  1062.       command.
  1063.  
  1064.     GET C "Press a key when ready . . ."
  1065.  
  1066.     This is more convenient than the PAUSE subcommand because the prompt can 
  1067.       be anything you want it to be such as "Press a key when you want to con- 
  1068.       tinue . . .".  As with the PAUSE command, it can be preceded in the 
  1069.       BATch file with ECHO statements giving more information as to what the 
  1070.       pause is for.  It is also more useful with the /A switch to control the 
  1071.       attribute, and/or the /W switch to control the pausing time.
  1072.  
  1073.     The optional argument [chars] is a single string of characters that limit 
  1074.       the acceptable user input.  Any other character entered will produce a 
  1075.       beep, and GET will wait for another character.  In addition to the com- 
  1076.       mon alphanumeric keyboard characters, special characters can be indi- 
  1077.       cated as discussed above under Surrogates and Extended Characters.  If 
  1078.       the /C switch is included, the user will not be able to exit by pressing 
  1079.       Ctrl-Break, and Ctrl-C will be treated like any other character; i.e. if 
  1080.       any chars are specified, then Ctrl-C will not be allowed because it can- 
  1081.       not be specified, but if no chars are specified then Ctrl-C will return 
  1082.       ASCII 3.  Ctrl-C is ASCII 3 and will be indicated by the number 3 in the 
  1083.       ErrorLevel and the ASCII character for 3, the heart, in the Environment.
  1084.  
  1085.     EXAMPLES:
  1086.  
  1087.     1. To issue a message and wait for a key to be pressed similar to the DOS 
  1088.       PAUSE subcommand:
  1089.  
  1090.  
  1091.  
  1092.   GET C                          GET Character                         Page 19
  1093.  
  1094.     ECHO Make sure your printer is turned on.
  1095.     GET C "Press a key when ready . . ."
  1096.  
  1097.     2. To present a simple menu and let the user make a selection.  The /C 
  1098.       switch indicates suppression of the Control-Break keystroke.  Neither 
  1099.       Control-C nor Control-Break will be accepted.
  1100.  
  1101.     :MENU
  1102.     ECHO A Word Processor
  1103.     ECHO B Spreadsheet
  1104.     ECHO C Database
  1105.     GET C "Select A, B, or C: " ABC /C
  1106.     IF "%GET%"=="A" GOTO WP
  1107.     IF "%GET%"=="B" GOTO SS
  1108.     IF "%GET%"=="C" GOTO DB
  1109.     GOTO MENU
  1110.     :WP
  1111.     Rem Call your word processor here
  1112.     GOTO MENU
  1113.     :SS
  1114.     Rem Call your spread sheet here
  1115.     GOTO MENU
  1116.     :DB
  1117.     Rem Call your database manager here
  1118.     GOTO MENU
  1119.  
  1120.     3. To illustrate the use of surrogates. The empty space between } and ~ is 
  1121.       the ASCII 255 character entered with Alt-255, not the regular space 
  1122.       character.  The /W20 waits 20 seconds for a response.  /A will cause the 
  1123.       prompt to be displayed in reverse video.
  1124.  
  1125.     :START
  1126.     GET C "Press <CR>, space bar, or Esc: " } ~ /W20 /A
  1127.     IF ErrorLevel 255 GOTO SPACE
  1128.     IF ErrorLevel 126 GOTO ESCAPE
  1129.     IF ErrorLevel 125 GOTO RETURN
  1130.     GOTO START
  1131.     :SPACE
  1132.     Echo The space bar was pressed.
  1133.     GOTO END
  1134.     :ESCAPE
  1135.     Echo The Escape key was pressed.
  1136.     GOTO END
  1137.     :RETURN
  1138.     Echo The Enter key was pressed.
  1139.     :END
  1140.  
  1141.     4. Same example as 3 using the Environment variable instead of the Error- 
  1142.       Level.  Note that " " is ASCII 255 in double quotes, not the regular 
  1143.       space character.  As above, the /W20 switch will wait for 20 seconds 
  1144.       then continue, but since none of the valid characters will be in the 
  1145.       %GET% variable, the next 3 lines will fall through and the GOTO START 
  1146.       line will cause a loop back to :START for another 20 second wait.
  1147.  
  1148.  
  1149.  
  1150.   Page 20                          GET Character                         GET C
  1151.  
  1152.     :START
  1153.     GET C "Press <CR>, space bar, or Esc: " } ~ /W20
  1154.     IF "%GET%"==" " GOTO SPACE
  1155.     IF "%GET%"=="~" GOTO ESCAPE
  1156.     IF "%GET%"=="}" GOTO RETURN
  1157.     GOTO START
  1158.     :SPACE
  1159.     Echo The space bar was pressed.
  1160.     GOTO END
  1161.     :ESCAPE
  1162.     Echo The Escape key was pressed.
  1163.     GOTO END
  1164.     :RETURN
  1165.     Echo The Enter key was pressed.
  1166.     :END
  1167.  
  1168.  
  1169.   GET N                        GET yes/no aNswer                       Page 21
  1170.  
  1171.     GET N                                                    Get yes/no aNswer
  1172.  
  1173.     Syntax: GET N[E] ["prompt"] [/switches]
  1174.     Input:  "prompt" to be displayed.
  1175.             /switches - /A /W /C /M /V /L
  1176.     Output: ErrorLevel - ASCII or surrogate code.
  1177.             Environment - character
  1178.  
  1179.     GET N is a special case of C that will accept only y, n, carriage return, 
  1180.       or Esc.  The Ctrl-C suppression and the number of seconds switches to 
  1181.       wait may be specified, but no [chars] argument will be recognized. The 
  1182.       syntax rules for GET C apply to GET N.  The only purpose for GET N is 
  1183.       just to make programming yes/no answers a bit simpler than using GET C 
  1184.       and having to always specify the YN and surrogate characters.
  1185.  
  1186.     EXAMPLES:
  1187.  
  1188.     1. The following two statements are functionally identical:
  1189.  
  1190.     GET N "Answer yes or no (y/n): "
  1191.     GET C "Answer yes or no (y/n): " YN}~
  1192.  
  1193.     2. Using ErrorLevel.  89 is the ASCII code for Y, 78 is the ASCII code for 
  1194.       N, 125 is the code for Carriage Return, and 126 for Escape.  A method of 
  1195.       using the Environment for defining variables is illustrated.
  1196.  
  1197.     GET N "Answer yes or no (y/n): "
  1198.     IF ErrorLevel 126 GOTO ESCAPE
  1199.     IF ErrorLevel 125 GOTO RETURN
  1200.     IF ErrorLevel 89 GOTO YES
  1201.     IF ErrorLevel 78 GOTO NO
  1202.     SET GET=Break
  1203.     GOTO END
  1204.     :ESCAPE
  1205.     SET GET=Escape
  1206.     GOTO END
  1207.     :RETURN
  1208.     SET GET=Return
  1209.     GOTO END
  1210.     :YES
  1211.     :NO
  1212.     :END
  1213.     Echo The %GET% key was pressed.
  1214.  
  1215.     3. Same example as 2.  This time the Environment is used instead of the 
  1216.       ErrorLevel.  Since we are not using Control-C suppression, it is pos- 
  1217.       sible to break out of the BATch file with Control-C or Control-Break in 
  1218.       this and the previous example. Remember that in many versions of DOS the 
  1219.       IF subcommand is case sensitive.  GET N converts all alphabetic charac- 
  1220.       ters to uppercase, so always use uppercase comparison unless you are 
  1221.       using the /L switch.
  1222.  
  1223.  
  1224.  
  1225.   Page 22                        GET yes/no aNswer                       GET N
  1226.  
  1227.     GET N "Answer yes or no (y/n): "
  1228.     IF "%GET%"=="~" GOTO ESCAPE
  1229.     IF "%GET%"=="}" GOTO RETURN
  1230.     IF "%GET%"=="Y" GOTO YES
  1231.     IF "%GET%"=="N" GOTO NO
  1232.     SET GET=Break
  1233.     GOTO END
  1234.     :ESCAPE
  1235.     SET GET=Escape
  1236.     GOTO END
  1237.     :RETURN
  1238.     SET GET=Return
  1239.     GOTO END
  1240.     :YES Put your code for Yes on lines after this label.
  1241.     GOTO END
  1242.     :NO  Put your code for No on lines after this label.
  1243.     :END
  1244.     Echo The %GET% key was pressed.
  1245.  
  1246.  
  1247.   GET T                           Moving Text                          Page 23
  1248.  
  1249.     GET T                                                          Moving Text
  1250.  
  1251.     Syntax: GET T[E] "filespec" [chars] [/switches]
  1252.     Input:  file specification containing moving text to be displayed.
  1253.             chars to specify the acceptable characters that can be entered.
  1254.             /switches - /M /V /L
  1255.     Output: ErrorLevel - ASCII or surrogate scan code.
  1256.             Environment - character
  1257.  
  1258.     GET T is another special case of GET C which provides a special effect. 
  1259.       The prompt information is presented as a moving line of text across the 
  1260.       bottom of the screen.  This permits having prompt strings up to 4096 
  1261.       characters long, and the motion of the characters helps to catch the 
  1262.       users attention.  T requires a file with the prompt string which will be 
  1263.       displayed moving across the bottom line of the screen. Currently only 
  1264.       standard 25 line screens are supported.  The text file should be plain 
  1265.       ASCII without any control characters (No CR, LF, or any other characters 
  1266.       below ASCII 32).  To be effective the prompt must be over 80 or more 
  1267.       characters long, and to ensure smooth wrap-around the first 79 charac- 
  1268.       ters should be repeated at the end.  The maximum length for the text of 
  1269.       the moving prompt is 4096 characters.  Over that it will be truncated. 
  1270.       T does not accept a number of seconds-to-wait argument at this time so 
  1271.       it will wait until a valid key is pressed.
  1272.  
  1273.     The T command can fail with an "Invalid Command" message if the file is 
  1274.       not properly specified and cannot be found, or if the prompt string is 
  1275.       less than 80 characters.  An ErrorLevel of zero should be tested to 
  1276.       determine if the command was successful (see example 2 below).  A prompt 
  1277.       string of exactly 80 characters will remain stationary.
  1278.  
  1279.     The question has been asked as to how to go about creating such a long 
  1280.       prompt string without carriage returns or other control characters. 
  1281.       Many text editors have the capability to do this by turning off word 
  1282.       wrap.  A good text editor will let you do just about anything you want 
  1283.       to do with ASCII text.  Most programmers use a text editor instead of a 
  1284.       word processor while creating and editing their code. Many word pro- 
  1285.       cessors will let you use them as text editors by specifying "non- 
  1286.       document" mode as appropriate.  As with many things related to program- 
  1287.       ming, trial and error experimentation is often the order of the day. 
  1288.       Sometimes it is called "hacking".
  1289.  
  1290.     EXAMPLES:
  1291.  
  1292.     1. If there is a file on the GET disk named SAMPLE.TXT, enter the follow- 
  1293.       ing command to see the moving text effect:
  1294.  
  1295.     GET T "SAMPLE.TXT"
  1296.  
  1297.     2.  Example 2 for GET C can easily be modified to use a moving text prompt 
  1298.       by changing GET C to GET T and replacing the prompt with the filename as 
  1299.       follows.  The timeout option is not effective with GET T.
  1300.  
  1301.  
  1302.  
  1303.   Page 24                           Moving Text                          GET T
  1304.  
  1305.     :START
  1306.     GET T "sample.txt" } ~
  1307.     IF NOT ErrorLevel 1 GOTO END
  1308.     IF ErrorLevel 255 GOTO SPACE
  1309.     IF ErrorLevel 126 GOTO ESCAPE
  1310.     IF ErrorLevel 125 GOTO RETURN
  1311.     GOTO START
  1312.     :SPACE
  1313.     Echo The space bar was pressed.
  1314.     GOTO END
  1315.     :ESCAPE
  1316.     Echo The Escape key was pressed.
  1317.     GOTO END
  1318.     :RETURN
  1319.     Echo The Enter key was pressed.
  1320.     :END
  1321.  
  1322.     In this example note the addition of the line IF NOT ErrorLevel 1 GOTO 
  1323.       END. If the named file is not found due to not being in the current 
  1324.       directory, or not having the correct path or name specified, then GET 
  1325.       will report "Invalid Command" and exit with ErrorLevel 0.  The added 
  1326.       statement is a check for ErrorLevel equal 0, and should always be in- 
  1327.       cluded when using the GET T command.  You may include drive and path 
  1328.       with the filename, but GET must be able to find it where it is specified 
  1329.       to be.
  1330.  
  1331.  
  1332.   GET S                           GET String                           Page 25
  1333.  
  1334.     GET S                                                           Get String
  1335.     Syntax: GET S[E] ["prompt"] [pattern] [/switches]
  1336.     Input:  "prompt" to be displayed.
  1337.             pattern to control character entry
  1338.             /switches - /A /W /C /M /V /U /~ /L
  1339.     Output: ErrorLevel - length of string entered.
  1340.             Environment - string.
  1341.  
  1342.     S accepts character string input terminated by a carriage return. SE is 
  1343.       the same but does not echo user input to the screen.  The latter is use- 
  1344.       ful for hiding the entry of a password, for example.  Extended and en- 
  1345.       hanced keys will not be accepted, but break can be suppressed with /C. 
  1346.       The length of the string entered is returned in ErrorLevel.  If the user 
  1347.       presses Esc, GET will exit with 0 in ErrorLevel as if a timeout has oc- 
  1348.       curred unless the /~ switch is specified as described below.
  1349.  
  1350.     As with GET C, the prompt will be issued and then GET will wait with the 
  1351.       cursor on the same line as the prompt for keyboard input.  If a /W is 
  1352.       specified, GET will wait the specified number of seconds for the first 
  1353.       key to be pressed, then exit with an ErrorLevel of 0 if no key has been 
  1354.       pressed.  If any key is pressed during the waiting period, the wait is 
  1355.       cancelled and GET waits for the user to press the Carriage Return (En- 
  1356.       ter) key.
  1357.  
  1358.     The /~ switch modifies the result if Escape is pressed.  If the Escape ac- 
  1359.       tion switch is specified as /~, when Esc is pressed GET will exit and 
  1360.       leave the Esc surrogate <~> in the Environment and 126 in ErrorLevel. 
  1361.       This permits testing whether it was in fact a timeout or if the user 
  1362.       pressed the Escape key.  The /~ switch is needed as a compatibility fea- 
  1363.       ture.  Without it, GET S will work as it did in Release 2.2.
  1364.  
  1365.     The length of a string for the S command can be controlled by creating a 
  1366.       pattern of characters equal in number to the maximum length of the 
  1367.       string allowed.  If the argument is omitted the default is 79 charac- 
  1368.       ters.  A beep will be sounded if the maximum length has been reached and 
  1369.       more characters are attempted, or if any characters do not match the 
  1370.       specified pattern.
  1371.  
  1372.     The pattern in the argument specifies the acceptable characters for each 
  1373.       position as follows.  Note that the uppercase characters T, A, and Z 
  1374.       will cause lowercase characters to be converted to uppercase.  Conver- 
  1375.       sions to uppercase will also cause the space character to be converted 
  1376.       to ASCII 255.  This will facilitate BATch file checking with the IF sub- 
  1377.       command.
  1378.            tT - any typeable character,     T - a-z will be uppercased.
  1379.            aA - any alphabetic character,   A - a-z will be uppercased.
  1380.            zZ - any alphanumeric character, Z - a-z will be uppercased.
  1381.             9 - any digit 0-9.           Alt-255 - space character only.
  1382.            Any other character must match the character entered exactly.
  1383.  
  1384.     In a sense you can think of Alt-255 as an uppercase space character.  Re- 
  1385.       member that the regular ASCII space is used as a delimiter so the scan- 
  1386.       ning of the pattern stops if an embedded space is encountered.  If you 
  1387.       need to specify the space, use the surrogate Alt-255, otherwise use t or 
  1388.       T if a space is permitted.  If you are going to test the input with the 
  1389.       DOS IF subcommand use Alt-255 or T.  This will cause the space to be 
  1390.       converted to an Alt-255 which can be tested.  Unless you are using 4DOS,  
  1391.  
  1392.  
  1393.   Page 26                           GET String                           GET S
  1394.  
  1395.       if you try to test a string which contains a space with IF, you will get 
  1396.       the message "Bad command or file name", even with MS DOS 5.0.  This is 
  1397.       because COMMAND.COM stops parsing the string when it encounters a space 
  1398.       which it considers to be a delimiter even if it is enclosed in quotes.
  1399.  
  1400.     EXAMPLES:
  1401.  
  1402.     1. The following example lets the user type in any characters up to a 
  1403.       limit of 79.  The string that is typed in will be in the Environment, 
  1404.       and the length of the string in the ErrorLevel.  Because the /~ switch 
  1405.       is used, if the user presses Esc, the Escape surrogate "~" will be in 
  1406.       the Environment and 126 in the ErrorLevel.  If the user presses Ctrl-C 
  1407.       or Ctrl-Break, DOS will break out of GET with no change to the GET vari- 
  1408.       able in the environment, and an undefined value in the ErrorLevel, pos- 
  1409.       sibly 3 for Ctrl-C..  For this reason it is a good idea to clear the GET 
  1410.       variable with the statement SET GET= before issuing the GET S command, 
  1411.       or use /C to suppress Ctrl-Break as in the next example.  The /U switch 
  1412.       causes lowercase characters in the string to be converted to uppercase 
  1413.       to facilitate IF tests.
  1414.  
  1415.       GET S /U /~
  1416.  
  1417.     2. This example asks the user for a password.  It does not echo the entry 
  1418.       to the screen to keep the password secure from prying eyes.  It sup- 
  1419.       presses Ctrl-Break but allows the BATch file to check to see if the user 
  1420.       entered Escape.  The password is limited to 8 alphabetic or numeric 
  1421.       characters, and all alpha characters will be converted to uppercase to 
  1422.       facilitate testing.  The /a switch causes the error message to be dis- 
  1423.       played in reverse video, and the /w switch causes GET to immediately 
  1424.       exit after displaying the prompt.
  1425.  
  1426.     :START
  1427.     GET SE "Enter your password: " ZZZZZZZZ /C /~
  1428.     if "%GET%"=="~" goto Escape
  1429.     if "%GET%"=="PASSWORD" goto PWOK
  1430.     Rem Display error message in reverse video
  1431.     GET C "Incorrect Password" /a /w
  1432.     goto START
  1433.     :Escape
  1434.     GET N "Do you want to cancel your logon? "
  1435.     if NOT "%GET%"=="Y" goto START
  1436.     Echo Your logon is cancelled.
  1437.     goto EXIT
  1438.     :PWOK
  1439.     Echo Your logon has been accepted
  1440.     Rem Do whatever is necessary here to complete the logon.
  1441.     :EXIT
  1442.  
  1443.     3. The next example gives the user 30 seconds to respond.  If there is no 
  1444.       first name entered within 30 seconds, GET will beep and the BATch file 
  1445.       will cycle back to :START and ask the question again.  If there is a 
  1446.       timeout on last name, the BATch file will report that the session is 
  1447.       cancelled and exit.  Only alphabetic characters are allowed, and the 
  1448.       first character will be automatically capitalized.
  1449.  
  1450.  
  1451.  
  1452.   GET S                           GET String                           Page 27
  1453.  
  1454.     :START
  1455.     GET S "Enter your first name " Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa /W30
  1456.     if NOT ErrorLevel 1 goto START
  1457.     SET FIRST=%GET%
  1458.     GET S "Enter your last name " Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa /W30
  1459.     if errorlevel 1 goto NAME
  1460.     Echo Your session is cancelled.
  1461.     Rem Do whatever is necessary to cancel session here.
  1462.     goto EXIT
  1463.     :NAME
  1464.     Echo Your name is %FIRST% %GET%
  1465.     :EXIT
  1466.  
  1467.  
  1468.   Page 28                        Check Key Buffer                        GET I
  1469.  
  1470.     GET I                                                     Check Key Buffer
  1471.     Syntax: GET I[E] "prompt"  [/switches]
  1472.     Input:  "prompt" to be displayed.
  1473.             /switches - /A /M /V /E /X
  1474.     Output: ErrorLevel - ASCII or surrogate scan code.
  1475.             Environment - character
  1476.  
  1477.     I checks to see whether a key has been pressed but it does not wait for a 
  1478.       keystroke if none is in the buffer; i.e. if the user has not pressed a 
  1479.       key in type-ahead mode.  The character that is waiting will be reported 
  1480.       in the same manner as for GET C, but it will remain in the keyboard 
  1481.       buffer.  If there is no character waiting, the ErrorLevel will be 0 and 
  1482.       GET or the variable specified with /V will be expunged from the Environ- 
  1483.       ment.
  1484.  
  1485.     IE will read the key if it is present and report it in the same manner as 
  1486.       C, or return 0 and expunge GET from the Environment if no character is 
  1487.       waiting.  The difference in the IE command from the C command is that IE 
  1488.       does not wait if no key is waiting.  If you specify a zero waiting time 
  1489.       for GET C with GET C /W or GET C /W0 it will be functionally equivalent 
  1490.       to GET IE.
  1491.  
  1492.     You can control whether Extended or Enhanced keys are to be included in 
  1493.       the same manner as for GET C.  A prompt can be included and will be dis- 
  1494.       played, which makes I useful to "echo" text to the screen like the DOS 
  1495.       ECHO command, but with GET you can specify reverse video or color at- 
  1496.       tributes.
  1497.  
  1498.     One way to make use of GET I is to allow a key to be pressed during boot- 
  1499.       up (or while any BATch file is running for that matter), then check to 
  1500.       see if a key has been pressed and take action accordingly, but if no key 
  1501.       was pressed there will be no delay.  Another use would be in a BATch 
  1502.       program that the user is familiar enough with that s/he may anticipate 
  1503.       the next question.  GET I could be used to check to see if the user has 
  1504.       answered the question before it was asked.
  1505.  
  1506.     EXAMPLES:
  1507.  
  1508.     1. In these examples a GET command (GET U), explained elsewhere, is used 
  1509.       to place a key in the keyboard buffer, then GET I checks to see if it is 
  1510.       there.  In this first example, the letter "a" is placed in the buffer 
  1511.       and GET I reports that "A" is waiting with ErrorLevel 65 and GET=A.  The 
  1512.       character "a" will remain in the buffer and will be available to the 
  1513.       next program that reads keyboard input.  In this case, neither extended 
  1514.       nor enhanced keys will be seen.
  1515.  
  1516.     Rem Simulate user pressing the "a" key.
  1517.     GET U "a"
  1518.     Rem Check to see if the key is in the buffer.
  1519.     GET I
  1520.     if ErrorLevel 1 goto ISTHERE
  1521.     Echo There is no key in the buffer.
  1522.     goto EXIT
  1523.     :ISTHERE
  1524.     Echo The key in the buffer is %GET%.
  1525.     :EXIT
  1526.     Rem Note that if you run this BATch file from the command line, you will
  1527.     Rem see "a" at the next DOS prompt when DOS reads the keyboard buffer.
  1528.  
  1529.  
  1530.   GET I                        Check Key Buffer                        Page 29
  1531.  
  1532.  
  1533.     2. Clearing the keyboard buffer.  By using the switch /E, both extended 
  1534.       and enhanced keys will be seen as well as all standard keys.  Do not use 
  1535.       /E unless you know that all users will have enhanced keyboards.   Note: 
  1536.       This example is for illustration only.  A faster method of clearing the 
  1537.       buffer is to use the /B switch.
  1538.  
  1539.     :LOOP
  1540.     GET IE /E
  1541.     if ErrorLevel 1 goto LOOP
  1542.  
  1543.     3. Suppose you would like to be able to do a clean boot without any TSR's 
  1544.       when you want to run a program such as a disk defragmenter.  You can 
  1545.       have GET I check if you have pressed a key, and skip your TSR's in your 
  1546.       AUTOEXEC.BAT if you have.
  1547.  
  1548.     GET IE
  1549.     if ErrorLevel 1 goto CONTINUE
  1550.     Rem Load first TSR here.
  1551.     Rem Load Second TSR here.
  1552.     Rem ...
  1553.     Rem Load Last TSR here.
  1554.     :CONTINUE with the rest of your AUTOEXEC.BAT
  1555.  
  1556.  
  1557.   Page 30                        Put String (Zap)                        GET Z
  1558.  
  1559.     GET Z                                                     Put String (Zap)
  1560.     Syntax: GET Z "string" [skip] [/switches]
  1561.     Input:  "string" to be placed in the Environment
  1562.             /switches - /M /V /U /L /W
  1563.     Output: ErrorLevel - length of string.
  1564.             Environment - string
  1565.  
  1566.     Z uses the "string" as input.  It will put the string into the Environment 
  1567.       as the value of the GET= or /Vvar= variable.  If you include the /M 
  1568.       switch, GET will attempt to bypass any secondary environments and put 
  1569.       the string in the master Environment.  By "master Environment" is meant 
  1570.       the environment of the original command processor that was loaded when 
  1571.       you started your computer, as contrasted with what we shall call the 
  1572.       "current" Environment defined as that of the command processor that is 
  1573.       running the BATch file.  The current Environment will be the same as the 
  1574.       master Environment unless a secondary command processor has been in- 
  1575.       voked. If GET is running under a secondary command processor, GET Z with 
  1576.       /M will attempt to bypass the current Environment of the secondary com- 
  1577.       mand processor and find the master environment.  In the latter case, the 
  1578.       GET variable will not be available to the current BATch file.  See dis- 
  1579.       cussion of Environment and Shells.
  1580.  
  1581.     If a numerical [skip] argument is specified, it will be taken to specify 
  1582.       the number of characters to skip over before transferring the remainder 
  1583.       of the string to the environment.  The /W switch can be used to specify 
  1584.       the maximum length of the string as described for GET ZE below.  Thus, 
  1585.       GET Z can be used to extract a substring from "string" starting with the 
  1586.       character after skip and using up to the number of characters specified 
  1587.       by /Wnnnn.  If [skip] is omitted the default is 0 meaning to start at 
  1588.       the beginning of the string.  NOTE: The use of /W with GET Z and GET ZE 
  1589.       is different from the use with other input commands where it denotes a 
  1590.       time to wait for input.
  1591.  
  1592.     GET Z can have several uses.  A few that come to mind are: uppercase a 
  1593.       string to test it with the IF subcommand, measure the length of a 
  1594.       string, count the number of times through a loop by measuring the length 
  1595.       of a string that has a character concatenated on each pass, fill out a 
  1596.       string to a fixed length by concatenating blanks and measuring its 
  1597.       length, extract a substring from a string.
  1598.  
  1599.     EXAMPLES:
  1600.  
  1601.     1. Place a string in the master Environment.  The master Environment will 
  1602.       then contain "GET=This is the string" and the ErrorLevel will be the 
  1603.       length of the string (18).  To verify that the string was placed in the 
  1604.       master Environment, first run a secondary command processor by typing 
  1605.       COMMAND at the DOS prompt.  Then run this example and see that the 
  1606.       string is not in the current environment by entering SET and viewing the 
  1607.       Environment.  Finally, enter EXIT to return to the original command pro- 
  1608.       cessor and enter SET again to see that the string is actually in the 
  1609.       master Environment.
  1610.  
  1611.       GET Z "This is the string" /M
  1612.  
  1613.     2. Suppose you want to fill out a string with blanks to reach a certain 
  1614.       fixed length.  In this example let the fixed length be 16.  This is one 
  1615.       way to implement a loop and control the number of times the loop occurs. 
  1616.       You can either right justify or left justify, and you can append spaces, 
  1617.       unlike using the DOS SET command.
  1618.  
  1619.  
  1620.   GET Z                        Put String (Zap)                        Page 31
  1621.  
  1622.  
  1623.     Rem Get user input, maximum of 16 characters.
  1624.     get s "Enter name: "  tttttttttttttttt /a
  1625.     :FILL If less than 16 characters entered, fill with blanks.
  1626.     if ErrorLevel 16 goto LENOK
  1627.     Rem Append a blank and loop back to check if enough
  1628.     get z "%GET% "
  1629.     goto FILL
  1630.     :LENOK Now we have the length we want.
  1631.     Echo "The string is %GET%"
  1632.  
  1633.     3. Use GET Z to extract the 3rd, 4th, and 5th characters from a string.
  1634.  
  1635.     Rem Turn on GET's reporting feature
  1636.     SET GET?=ON
  1637.     GET Z "abcdef" 2 /w3
  1638.     The Environment is: cde
  1639.     The ErrorLevel is: 3
  1640.  
  1641.     4. Suppose there is an Environment variable named VER and that in this 
  1642.       case it has the value VER=3.31.  We can extract the DOS minor version 
  1643.       with GET Z as follows.
  1644.  
  1645.     GET Z "%VER%" 2
  1646.     The Environment is: 31
  1647.     The ErrorLevel is: 2
  1648.  
  1649.     5. Use GET Z to make sure an environment string is in uppercase to facili- 
  1650.       tate testing it with the BATch IF subcommand.  Spaces will be converted 
  1651.       to ASCII-255 otherwise the DOS IF test would fail.  Remember to use 
  1652.       ASCII-255 for the test in your BATch file if there are any spaces.  Let 
  1653.       "varname" be the name of a variable in the Environment.
  1654.  
  1655.       GET Z "%varname%" /U /Vvarname=
  1656.       Rem In the next line, the "space" between B and S is really ASCII-255.
  1657.       IF "%varname%"=="BOB STEPHAN" goto NAMEOK
  1658.       Echo The name did not match
  1659.       goto END
  1660.       :NAMEOK
  1661.       Echo The name matched
  1662.       :END
  1663.  
  1664.  
  1665.   Page 32                         Standard Input                        GET ZE
  1666.  
  1667.     GET ZE                                                      Standard Input
  1668.  
  1669.     Syntax: GET ZE "prompt" [/switches]
  1670.     Input:  "prompt" to be displayed.
  1671.             /switches - /A /M /V /U /W /L
  1672.     Output: ErrorLevel - length of string.
  1673.             Environment - string.
  1674.  
  1675.     ZE will take input from Standard Input and transfer it to the GET= or 
  1676.       /Vvar= variable in the Environment.  The input must be less than 80 
  1677.       characters and must be terminated with a carriage return.  ZE will take 
  1678.       input from the keyboard (Get String), or from redirection or piping.  If 
  1679.       you specify a prompt for ZE, it will be displayed before reading stan- 
  1680.       dard input.  GET ZE works similar to GET S, but uses DOS to obtain the 
  1681.       input string from the user; therefore, it is not able to monitor each 
  1682.       keystroke and will not be able to suppress Ctrl-Break with the /C 
  1683.       switch.  You can force the string to uppercase with the /U switch, or to 
  1684.       lowercase with the /L switch.
  1685.  
  1686.     /W can be used with both GET Z and GET ZE to specify the maximum length of 
  1687.       the string.  If the input string is longer than the maximum specified 
  1688.       with /W, it will be truncated to the length specified.
  1689.  
  1690.     EXAMPLES:
  1691.  
  1692.     1. GET S uses the BIOS interrupt to get characters from the user, but you 
  1693.       can also use DOS Standard Input with GET ZE.  The prompt will be dis- 
  1694.       played and the string can be entered from the keyboard for a maximum of 
  1695.       79 characters.  The /U switch can be used to force the environment vari- 
  1696.       able to uppercase, but the user will see it just as it was typed in.
  1697.  
  1698.       GET ZE "Enter a string: "  /U
  1699.  
  1700.     2. You can use GET ZE to pipe the current directory into the current En- 
  1701.       vironment by using DOS piping.  This could be used to redirect any stan- 
  1702.       dard output into an Environment variable.  Of course, GET Y is the 
  1703.       preferred method of putting the current directory into the Environment 
  1704.       with GET, but this illustrates the method to do it with any program that 
  1705.       writes to standard output.  In some cases piping CD into GET ZE might be 
  1706.       preferable because CD includes the drive specification.
  1707.  
  1708.     CD|GET ZE
  1709.     The Environment is: D:\QPRO
  1710.     The ErrorLevel is: 7
  1711.  
  1712.     3. You can read the first line of a text file.  If you don't want to see 
  1713.       the echo from DOS, redirect the output to NUL.  The general syntax is 
  1714.       GET ZE<filespec>NUL.  In this example, the output from the DOS DATE com- 
  1715.       mand is redirected to a file, then read in to the Environment with GET 
  1716.       ZE, and finally the day of the week is extracted with GET Z.  NOTE: The 
  1717.       date could also have been piped directly into GET as in the previous ex- 
  1718.       ample, but for the purposes of this example an intermediate file is 
  1719.       used.
  1720.  
  1721.  
  1722.   GET ZE                         Standard Input                        Page 33
  1723.  
  1724.  
  1725.     Rem Stack <return> to automate the DATE command.
  1726.     get u 13
  1727.     Rem Use the DOS DATE command to create a file for the date
  1728.     date >date.txt
  1729.     Rem The first line of the file will have the format
  1730.     Rem Current date is Sun 11-17-1991
  1731.     Rem Read the first line into the variable GET=.
  1732.     get ze <date.txt
  1733.     Rem Extract the day of the week in characters 17-19
  1734.     get z "%GET%" 16 /w3
  1735.     Rem The Environment will now contain the variable GET=Sun.
  1736.     Rem
  1737.     Rem NOTE: Different versions of DOS have different formats
  1738.     Rem for the output of the DATE command.
  1739.     Rem
  1740.     Rem Now erase the temporary file.
  1741.     del date.txt
  1742.  
  1743.  
  1744.  
  1745.   Page 34                          'Rithmetic                          GET.DOC
  1746.  
  1747.     GET R                                                           'Rithmetic
  1748.  
  1749.     Syntax: GET R[E] num1 [/Wnum2] [/switches]
  1750.     Input:  one or two numbers, maximum of 4 digits each.
  1751.             /switches - /M /V /W
  1752.     Output: ErrorLevel - num1+num2, RE - num1-num2
  1753.             Environment - same as ErrorLevel
  1754.  
  1755.     R for 'Rithmetic adds or subtracts two numbers.
  1756.               GET R adds the two numbers
  1757.               GET RE subtracts the second from the first
  1758.  
  1759.     The arithmetic result is in both the Environment and ErrorLevel. If only 
  1760.       one number is given, the other number defaults to 0.  The max number of 
  1761.       digits for each number is 4. Thus a character representation of a number 
  1762.       can be converted to a number in the ErrorLevel.  See examples below for 
  1763.       information about results larger than 255 or negative.
  1764.  
  1765.     EXAMPLES:
  1766.  
  1767.     1. Convert a numerical Environment variable to an ErrorLevel.  Suppose the 
  1768.       following string is in the Environment: VAR=45. Then
  1769.  
  1770.     GET R %VAR%
  1771.  
  1772.     will set the ErrorLevel to 45, and place GET=45 in the Environment.
  1773.  
  1774.     2. Suppose you need to set up a loop in a BATch file.  You can do it this 
  1775.       way.
  1776.  
  1777.     SET COUNT=0
  1778.     :LOOP
  1779.     GET R %COUNT% /W1 /VCOUNT=
  1780.     Echo The count is %COUNT%
  1781.     IF NOT ERRORLEVEL 10 GOTO LOOP
  1782.  
  1783.     3. You can use GET R to pass a return code from a CALLed BATch file to its 
  1784.       parent.  Of course, this could have been done by SETting and Environe- 
  1785.       ment variable, but with GET R you can use the ErrorLevel if you want.
  1786.  
  1787.     Echo This is the child batch file.
  1788.     Rem Set the default ErrorLevel to 0, suppress Environment variable.
  1789.     GET R 0 /V-
  1790.     Rem Now make tests and set ErrorLevel accordingly.
  1791.     If "%COMSPEC%"=="C:\COMMAND.COM" get r 1 /V-
  1792.     If "%COMSPEC%"=="C:\4DOS.COM" get r 4 /V-
  1793.  
  1794.     @Echo off
  1795.     Rem This is the parent file.
  1796.     CALL CHILD
  1797.     If ErrorLevel 4 Echo 4DOS is loaded.
  1798.     If ErrorLevel 1 Echo COMMAND.COM is loaded.
  1799.     If Not ErrorLevel 1 Echo Unknown command processor.
  1800.  
  1801.     4. If the result is greater than 255, the ErrorLevel is modulo 256.
  1802.        For example: 256=0, 257=1, ..., 511=255, 512=0, etc.
  1803.  
  1804.     set GET?=on
  1805.  
  1806.  
  1807.   GET.DOC                          'Rithmetic                          Page 35
  1808.  
  1809.     GET R 195 /W350
  1810.     The Environment is: 545
  1811.     The ErrorLevel is: 33
  1812.  
  1813.     5. GET uses simple computer integer arithmetic.  Negative numbers are not 
  1814.       recognized as such.  If a larger number is subtracted from smaller, the 
  1815.       result is 65536 minus the absolute value of the difference.
  1816.  
  1817.     GET RE 10 /W20
  1818.     The ErrorLevel is 246
  1819.     The Environment is 65526
  1820.  
  1821.  
  1822.   Page 36                      Clear (Blank) Screen                      GET B
  1823.  
  1824.     GET B                                                 Clear (Blank) Screen
  1825.  
  1826.     Syntax: GET B[E] [New attribute] [/switches]
  1827.     Input: desired new attribute in decimal for B, hex for BE.
  1828.            /switches /M /V
  1829.     Output: ErrorLevel - old attribute (decimal of course).
  1830.             Environment - old attribute in decimal, hex for BE.
  1831.  
  1832.     B  the screen Blanker actually performs a clear screen, not a true blank- 
  1833.       ing which leave the screen display intact but merely hides it.  By doing 
  1834.       so, it is able to control the screen attribute (color).   GET B uses 
  1835.       your color settings unless you give it a different attribute to use.  It 
  1836.       automatically adapts to any number of lines on the screen (e.g. EGA 43 
  1837.       or VGA 50).
  1838.  
  1839.     If an attribute argument is given it is taken to be a 1, 2, or 3-digit 
  1840.       decimal number that is converted to a two-digit hexadecimal number for 
  1841.       the attribute.  The same table of colors and attributes that is used for 
  1842.       the /A switch is used for the GET B command.
  1843.  
  1844.     BE regards an argument as a 1 or 2-digit hex number, and the GET value in 
  1845.       the Environment is in hex.
  1846.  
  1847.     EXAMPLES:
  1848.  
  1849.     1. Do a simple ClearScreen (CLS) without changing colors or number of 
  1850.       lines.  Suppose the old attribute was black and white.
  1851.  
  1852.     Rem Turn on GET reporting feature
  1853.     SET GET?=ON
  1854.     GET B
  1855.     The Environment is: 7
  1856.     The ErrorLevel is: 7
  1857.  
  1858.     2. Set color to blue background with white text.  Save the old attribute 
  1859.       in the environment variable ATTR.
  1860.  
  1861.     GET B 23 /VATTR=
  1862.     The Environment is: 7
  1863.     The ErrorLevel is: 7
  1864.  
  1865.     3. Restore the saved attribute.
  1866.  
  1867.     GET B %ATTR%
  1868.     The Environment is: 23
  1869.     The ErrorLevel is: 23
  1870.     Rem Turn off GET reporting feature
  1871.     SET GET?=
  1872.  
  1873.  
  1874.   GET V                       Get/set video mode                       Page 37
  1875.  
  1876.  
  1877.     GET V                                                   Get/set video mode
  1878.  
  1879.     Syntax: GET V[E] [New mode/color] [/switches]
  1880.     Input: optional new video mode for V or color for VE.
  1881.            /switches /M /V
  1882.     Output: ErrorLevel - old mode or color
  1883.             Environment - old mode or color
  1884.  
  1885.     V reports and optionally sets the video mode.  Don't change Video mode un- 
  1886.       less you have a specific reason for doing so to prevent setting a mode 
  1887.       that is not supported by the system running the BATch file.
  1888.  
  1889.     The following Video Display Mode table is excerpted from "The New Peter 
  1890.       Norton Programmer's Guide to The IBM PC & PS/2," page 72.
  1891.  
  1892.         Mode #    Type        Resolution    Colors     Video Subsystem
  1893.          0, 1     Text        40 x 25         16       CGA, EGA, MCGA, VGA
  1894.          2, 3     Text        80 x 25         16       CGA, EGA, MCGA, VGA
  1895.          4, 5     Graphics    320 x 200       4        CGA, EGA, MCGA, VGA
  1896.          6        Graphics    640 x 200       2        CGA, EGA, MCGA, VGA
  1897.          7        Text        80 x 25         Mono     CGA, EGA, MCGA, VGA
  1898.          8, 9, 10                                      PCjr only
  1899.          11, 12                                        Used internally
  1900.          13       Graphics    320 x 200       16       EGA, VGA
  1901.          14       Graphics    640 x 200       16       EGA, VGA
  1902.          15       Graphics    640 x 350       Mono     EGA, VGA
  1903.          16       Graphics    640 x 350       16       EGA, VGA
  1904.          17       Graphics    640 x 480       2        MCGA, VGA
  1905.          18       Graphics    640 x 480       16       VGA
  1906.          19       Graphics    320 x 200       25       MCGA, VGA
  1907.  
  1908.     EXAMPLES:
  1909.  
  1910.     1. Get the current video mode and save it in the variable VIDEO.  Change 
  1911.       to video mode 2.  Later restore the original mode.
  1912.  
  1913.     GET V 2 /vvideo=
  1914.     Rem Do what you need to with mode 2
  1915.     Rem Restore original mode
  1916.     GET V %VIDEO%
  1917.     Rem Clear out VIDEO variable
  1918.     SET VIDEO=
  1919.  
  1920.     2. Suppose you have an "ill behaved" program such as a game that leaves 
  1921.       the video in a graphics mode when it exits.  You can save the orginal 
  1922.       mode before executing the game, then restore it later.
  1923.  
  1924.     Rem Store original video mode
  1925.     GET V /vvideo=
  1926.     Rem Run the ill behaved game
  1927.     GAME
  1928.     Rem Restore original mode
  1929.     GET V %VIDEO%
  1930.     Rem Clear out VIDEO variable
  1931.     SET VIDEO=
  1932.  
  1933.  
  1934.   Page 38                      Get/set video border                     GET VE
  1935.  
  1936.     GET VE                                                Get/set video border
  1937.  
  1938.     VE will get/set the border color on a VGA or EGA monitor.  See the color 
  1939.       table below.  One interesting use is to set different border colors for 
  1940.       each of your DESQview windows if you are a DV user. GET VE will take any 
  1941.       of the 8 basic color codes 0-7.  The additional combinations that can be 
  1942.       used for /A or GET B have no meaning for GET VE.
  1943.  
  1944.             The color codes are:
  1945.                0 Black         2 Green      4 Red          6 Brown
  1946.                1 Blue          3 Cyan       5 Magenta      7 White
  1947.  
  1948.     EXAMPLES:
  1949.  
  1950.     1. Set the border color to red.  It was black.
  1951.  
  1952.     Rem Turn on GET reporting feature
  1953.     SET GET?=ON
  1954.     GET VE 4
  1955.     The Environment is: 0
  1956.     The ErrorLevel is: 0
  1957.     Rem Turn off GET reporting feature
  1958.     SET GET?=
  1959.  
  1960.  
  1961.   GET H                          Date and Time                         Page 39
  1962.  
  1963.  
  1964.     GET H                                                        Date and Time
  1965.  
  1966.     Syntax: GET H[E] code [/switches]
  1967.     Input: Code from the table below
  1968.            /switches /M /V
  1969.     Output: ErrorLevel -
  1970.             Environment -
  1971.  
  1972.     H  The H Date and Time command works differently than most of the others. 
  1973.       The value to be obtained is determined by a coded numerical argument. 
  1974.       The codes are as follows with 1 being the default.
  1975.           1 Day of the Week - Sunday=0           16 Hour
  1976.           2 Day of the Month                     32 Minute
  1977.           4 Month - January=1                    64 Second
  1978.           8 Year                                128 Odd or Even (H only)
  1979.  
  1980.       For H, only one value is returned for each call of GET.  The Environment 
  1981.       will contain the character representation of the ErrorLevel, except for 
  1982.       Year, or for the Odd/Even feature, or if no code is given.  Since Error- 
  1983.       Level has a maximum of 255, only the last two digits of the year will be 
  1984.       reported, but the Environment will have the full value.  If no code is 
  1985.       given, the ErrorLevel will contain the default Day of the Week but no 
  1986.       Environment variable will be created.
  1987.  
  1988.     The Odd/Even feature is obtained by adding 128 to the desired code.  The 
  1989.       Environment will contain the value for the code, but the ErrorLevel will 
  1990.       be 1 if the value is odd or 0 if it is even.  This provides a means to 
  1991.       alternate doing something like running COMPRESS on C: on even days and 
  1992.       D: on odd days.  A code of 128 by itself will put the odd or even in- 
  1993.       dicator for the Day of the Week in the ErrorLevel but no Environment 
  1994.       variable will be created.
  1995.  
  1996.     HE will place a concatenated string in the environment.  You can "build 
  1997.       your own" string.  HE requires that you add up the codes for the values 
  1998.       you want concatenated.  With this form of the command the ErrorLevel is 
  1999.       the length of the GET variable, but it is not very meaningful or useful. 
  2000.       128 does nothing for HE either.
  2001.  
  2002.     If you can find a use for it with HE, you can include a "prompt" string in 
  2003.       double quotes.  The Environment variable will contain the prompt string 
  2004.       with the requested date and/or time information concatenated.
  2005.  
  2006.     EXAMPLES:
  2007.  
  2008.     1.  This is a rather elaborate BATch file that can be called to provide a 
  2009.       formatted date.  Call it SHOWDATE.BAT.  When you call SHOWDATE it will 
  2010.       report something like "The date is August 25, 1991".  This information 
  2011.       could just as easily be stored as an Environment variable for use by 
  2012.       other BATch files and programs.
  2013.  
  2014.  
  2015.  
  2016.   Page 40                          Date and Time                         GET H
  2017.  
  2018.     @Echo Off
  2019.     GET H 4
  2020.     If "%GET%"=="12" set MONTH=December
  2021.     If "%GET%"=="11" set MONTH=November
  2022.     If "%GET%"=="10" set MONTH=October
  2023.     If "%GET%"=="9" set MONTH=September
  2024.     If "%GET%"=="8" set MONTH=August
  2025.     If "%GET%"=="7" set MONTH=July
  2026.     If "%GET%"=="6" set MONTH=June
  2027.     If "%GET%"=="5" set MONTH=May
  2028.     If "%GET%"=="4" set MONTH=April
  2029.     If "%GET%"=="3" set MONTH=March
  2030.     If "%GET%"=="2" set MONTH=February
  2031.     If "%GET%"=="1" set MONTH=January
  2032.     Get H 2 /VDAY=
  2033.     Get H 8 /VYR=
  2034.     Echo The date is %MONTH% %DAY%, %YR%
  2035.  
  2036.     2. A GET BATch file can easily be set up to wait until a given time by 
  2037.       using the H feature.  In this example the first pair of GET calls checks 
  2038.       every 15 minutes for the hour you want to wait until - in this case 11 
  2039.       p.m. or 23 in computer parlance.  The next pair of GET calls checks the 
  2040.       time once a minute and waits until the minute is 30.  The BATch file 
  2041.       will continue executing at 11:30 p.m. or shortly thereafter.
  2042.  
  2043.     @echo off
  2044.     :HOUR Check the hour every 15 minutes.
  2045.     GET C /W900
  2046.     GET H 16
  2047.     if not "%GET%"=="23" goto HOUR
  2048.     :MINUTE Check the minute every 60 seconds.
  2049.     GET C /W60
  2050.     GET H 32
  2051.     if not ErrorLevel 30 goto MINUTE
  2052.     Rem The BATch file will continue here at 11:30 p.m.
  2053.  
  2054.     3.  The above BATch file can be parameterized so it can be called with the 
  2055.       hour and minute that you want it to wait until.  Name this BATch file 
  2056.       WAITFOR.BAT, then at the DOS prompt enter WAITFOR hour minute.  For ex- 
  2057.       ample, WAITFOR 23 30.  A BATch file like this can be run in a DESQview 
  2058.       window in the background and produce an alarm at a given time, or ex- 
  2059.       ecute a program in the background or when the computer is unattended. 
  2060.       It can easily be tuned down to the minute, or even the second by how 
  2061.       fine you make the checkpoint intervals.
  2062.  
  2063.     @echo off
  2064.     :HOUR Check the hour every 15 minutes.
  2065.     GET C /W900
  2066.     GET H 16
  2067.     if not "%GET%"=="%1" goto HOUR
  2068.     :MINUTE Check the minute every 60 seconds.
  2069.     GET C /W60
  2070.     GET H 32
  2071.     if not ErrorLevel %2 goto MINUTE
  2072.     Rem The BATch file will continue here at the hour and minute you specify.
  2073.     Rem Sound your alarm, or do whatever here, for example,
  2074.     Echo ^G  ^G  ^G  ^G  ^G
  2075.  
  2076.  
  2077.  
  2078.   GET H                          Date and Time                         Page 41
  2079.  
  2080.     4. Here are some BATch statements I use in my AUTOEXEC.BAT to do some 
  2081.       things only once a day, such as run DOS 5.0 MIRROR to save a copy of my 
  2082.       system information in case of a crash.  The current date is saved on 
  2083.       disk in a BATch file named SETDATE.BAT.  It contains one line, for exam- 
  2084.       ple: SET DATE=29.  When I CALL SETDATE it stores the last saved date in 
  2085.       the Environment as the DATE= variable.  Then I use GET to get today's 
  2086.       date and compare it with %DATE%.  If they compare, I know that I have 
  2087.       already done my once-a-day procedures and can skip them this time.  If 
  2088.       they don't compare, a new SETDATE.BAT is automatically created, and the 
  2089.       once-a-day statements are executed.  Follow it through here:
  2090.  
  2091.     Rem Call SETDATE to store the last saved date in the Environment
  2092.     CALL SETDATE
  2093.     Rem Get today's date to compare with.
  2094.     GET H 2
  2095.     Rem Compare the last saved date with today's date.
  2096.     IF "%DATE%"=="%GET%" GOTO DATEOK
  2097.     Rem If false, recreate SETDATE with today's date.
  2098.     ECHO SET DATE=%GET% >SETDATE.BAT
  2099.     Rem Do your once-a-day procedures here; for example ...
  2100.     MIRROR D: E: F:
  2101.     Rem If the dates compared we would skip the above lines
  2102.     Rem thus speeding up succeeding boots.
  2103.     DATEOK:
  2104.     Rem Continue with your AUTOEXEC.BAT here.
  2105.     Rem Run MIRROR on your boot drive and load delete tracking for all drives
  2106.     MIRROR C: /TC /TD /TE /TF
  2107.  
  2108.     5. HE was designed to produce output in the same form required by the DOS 
  2109.       DATE and TIME commands.  For example, if you need to temporarily change 
  2110.       the system date (or time) and later restore it, you can do it with the 
  2111.       following BATch file.
  2112.  
  2113.     @Echo off
  2114.     Rem HE 14 will report mm-dd-yy in the Environment: 14=2+4+8.
  2115.     get HE 14 /VDATE=
  2116.     Rem Now set the date as you need it for whatever reason, for example:
  2117.     DATE 6-15-90
  2118.     Rem Now run the program that requires the new date.
  2119.     Rem . . .
  2120.     Rem Now restore the original date.
  2121.     DATE %DATE%
  2122.     Rem Clear out the DATE variable (unless you want to save it to use again).
  2123.     SET DATE=
  2124.  
  2125.     6. Concatenate a "prompt" string with the date.
  2126.  
  2127.     Rem Turn on the GET reporting feature
  2128.     SET GET?=ON
  2129.     GET HE "The date is" 14
  2130.     The Environment is: The date is  8-29-91
  2131.     The ErrorLevel is: 20
  2132.     Rem Turn off the reporting feature
  2133.     SET GET?=
  2134.  
  2135.  
  2136.   Page 42                         Keyboard BUffer                        GET U
  2137.  
  2138.  
  2139.     GET U                                                      Keyboard BUffer
  2140.  
  2141.     Syntax: GET U "chars" num /Wnum [/switches]
  2142.     Input: characters and key codes to place in key buffer
  2143.            /switches /M /V /W /B
  2144.     Output: ErrorLevel - Number of characters actually stacked
  2145.             Environment - Not used, GET or /V variable will be cleared out.
  2146.  
  2147.     U  will stack keys in the keyboard bUffer.  The syntax is GET U "chars" 
  2148.       num /Wnum where chars are any ASCII characters you want stacked in dou- 
  2149.       ble quotes, and the "num"s are decimal representations of values for ei- 
  2150.       ther ASCII codes or scan codes.  Up to 4 digits can be used for either 
  2151.       number.  E.g. to end the string with a carriage return use 13 or /W13. 
  2152.       To enter a scan code add it to 255.  Note that this is purposely dif- 
  2153.       ferent from the scan code surrogates for the GET C command.
  2154.  
  2155.     NOTE: GET U will only work on PC/XT's with BIOS dated 01/10/86 and later, 
  2156.       PC/AT's with BIOS dated 11/15/85 and later, and PS/2s!
  2157.  
  2158.     With GET U you can provide a default entry for a GET S string; however, 
  2159.       the DOS keyboard buffer only holds 15 characters, so it has to be rather 
  2160.       short.  Use GET U "default" followed by GET S "prompt", and the default 
  2161.       string will be entered for the user.  The user can either change it by 
  2162.       backspacing or accept it by pressing enter.
  2163.  
  2164.     The ErrorLevel will contain the number of characters or codes actually 
  2165.       placed in the buffer.  If the buffer fills up before all the characters 
  2166.       or codes are stacked, GET will beep and exit.  By testing the ErrorLevel 
  2167.       for the number of characters and codes, you can tell if the stacking was 
  2168.       successful.  To make the full buffer available, the /B switch can be 
  2169.       used to clear the buffer.
  2170.  
  2171.     EXAMPLES
  2172.  
  2173.     1. The following will stack the word "help" in the buffer and execute it 
  2174.       as a command by also stacking the Enter key (ASCII 13 for CR).  To make 
  2175.       the stacked command execute, the BATch file must exit to activate the 
  2176.       DOS prompt.
  2177.  
  2178.     GET U "help" 13 /B
  2179.     Rem Test that 5 characters were stacked
  2180.     if ErrorLevel 5 goto EXIT
  2181.     Rem Not all characters were stacked, so clear the buffer and exit
  2182.     GET I /B
  2183.     :EXIT
  2184.  
  2185.     2. The scan code for F1 is decimal 59 so use 314 (=59+255). The following 
  2186.       command will stack the F1 key (The HELP key for 4DOS):
  2187.  
  2188.     GET U 314
  2189.  
  2190.  
  2191.   GET U                         Keyboard BUffer                        Page 43
  2192.  
  2193.  
  2194.     3.  Some programs pause when they are loading and require the user to 
  2195.       press a key to continue.  If the program does not clear the keyboard 
  2196.       buffer, then GET U can stack the keystroke(s) to automate the loading of 
  2197.       the program.  It could also automate the first few program command keys. 
  2198.       In this example we will stack the characters to bring up a spreadsheet 
  2199.       file list in Quattro Pro.
  2200.  
  2201.     Rem /FR is the Retrieve command for Quattro Pro
  2202.     GET U "/FR"
  2203.     Rem Now call Quattro Pro - the spreadsheet list will be displayed.
  2204.     Q
  2205.  
  2206.  
  2207.   Page 44                          Shift Locks                          GET UE
  2208.  
  2209.     GET UE                                                         Shift Locks
  2210.  
  2211.     Syntax: GET UE [/Wnum] [/switches]
  2212.     Input: numerical code to set or clear keyboard locks.
  2213.            /switches /M /V /W
  2214.     Output: ErrorLevel - Old value
  2215.             Environment - Old value
  2216.  
  2217.     UE will let you adjust the Caps, Num, and Scroll Locks. Sum the numbers 
  2218.       for Scroll=16, Num=32, Caps=64 for the Locks you want to set.  The 
  2219.       other(s) will be cleared.  You must use GET UE /Wnum not just GET UE 
  2220.       num.  CAUTION: Don't forget the /W.
  2221.  
  2222.     EXAMPLES
  2223.  
  2224.     1. Turn off NumLock and ScrollLock, turn on CapsLock
  2225.  
  2226.     GET UE /W64
  2227.  
  2228.     2. Turn on both NumLock and CapsLock, turn off ScrollLock.
  2229.  
  2230.     Rem Turn on GET reporting feature
  2231.     SET GET?=ON
  2232.     GET UE /W96
  2233.     The Environment is: 64
  2234.     The ErrorLevel is: 64
  2235.  
  2236.     3. Turn off all key locks
  2237.  
  2238.     GET UE
  2239.     The Environment is: 96
  2240.     The ErrorLevel is: 96
  2241.     Rem Turn off GET reporting feature
  2242.     SET GET?=
  2243.  
  2244.     4. Turn on CapsLock, then restore original setting
  2245.  
  2246.     Rem Turn on Caps and Num Locks to get user input
  2247.     Rem Save original setting in LOCK.
  2248.     GET UE /W96 /VLOCK=
  2249.     Rem Get string input from user in upper case and numbers.
  2250.     GET S "Enter information now: "
  2251.     Rem Restore original lock settings
  2252.     GET UE /W%LOCK%
  2253.     Rem Clear out the LOCK variable
  2254.     SET LOCK=
  2255.  
  2256.  
  2257.   GET.DOC                 Get DISK and FILE Information                Page 45
  2258.  
  2259.   GET DISK and FILE Information
  2260.  
  2261.   The commands K, Q, L, F, and Y obtain information about disks and/or files. 
  2262.     Note that Q, K, and L check to see if the drive contains a formatted disk, 
  2263.     and they return an ErrorLevel 0 if it does not.  This avoids the Abort, 
  2264.     Retry, etc. error handling.  If the ErrorLevel is 0 the error code will be 
  2265.     in %GET% as a hexadecimal value.
  2266.  
  2267.   Some error code values of interest are:
  2268.         0 - Write protected diskette (n/a since GET does not write)
  2269.         1 - Invalid drive letter
  2270.         2 - Drive not ready - no disk or door open.
  2271.         4, 6, 7, 8, & B - Disk read errors
  2272.         C - General, nonspecific error.
  2273.         F - Invalid disk change
  2274.  
  2275.     GET K                                                  Get disk free space
  2276.  
  2277.     Syntax: GET K[E] [drive][/Wdiv] [/switches]
  2278.     Input:  drive letter and optionally divisor
  2279.             /switches - /M /V /L /W
  2280.     Output: ErrorLevel - KiloBytes/10, KE - KiloBytes/100
  2281.             Environment - KiloBytes
  2282.  
  2283.     K takes the argument to be a drive letter.  The colon is not required. 
  2284.       The default is the current drive.  Optionally a divisor can be included 
  2285.       after the /W switch.
  2286.  
  2287.     K, as well as Q and L, starts out by attempting a direct read of the disk. 
  2288.       If this fails by reason of one of the errors mentioned above, GET 
  2289.       reports the error and exits.  This avoids the annoying "Abort, Retry, 
  2290.       Ignore, Fail?" message if the drive is not ready for some reason, and 
  2291.       lets the BATch programmer handle the error as appropriate to the ap- 
  2292.       plication.  If the read is successful, GET K obtains the disk informa- 
  2293.       tion and calculates the free space.
  2294.  
  2295.     Disk free space is reported in kilobytes (kb) in the Environment.  To 
  2296.       verify the value you can take the free space reported by CHKDSK and di- 
  2297.       vide it by 1024, the number of bytes in a kb.  The result should come 
  2298.       out exactly.  The value reported in the Environment is the same for GET 
  2299.       K and GET KE.
  2300.  
  2301.     Since the ErrorLevel can only report numbers up to 255, GET reduces the 
  2302.       value that is reported, but this does not affect the value in the En- 
  2303.       vironment.  For GET K the number of kb is divided by 10, and for GET KE, 
  2304.       the kb is divided by 100.  For disks with very large partitions, this 
  2305.       may still not reduce the amount reported below 255, so GET also has pro- 
  2306.       visions for an optional programmer supplied divisor.  For example, an 
  2307.       argument of /W1024 will divide by 1024, and the ErrorLevel will contain 
  2308.       approximate megabytes of free space.  The /W notation is the new 
  2309.       preferred method.
  2310.  
  2311.     EXAMPLES:
  2312.  
  2313.     1. Assume that CHKDSK reports "8,386,560 bytes available on disk".  Then
  2314.     GET K reports
  2315.  
  2316.     Rem Turn on GET reporting feature
  2317.  
  2318.  
  2319.   Page 46                       Get disk free space                      GET K
  2320.  
  2321.     SET GET?=ON
  2322.     GET K
  2323.     The Environment is: 8190
  2324.     The ErrorLevel is: 255
  2325.  
  2326.     In this case 8190 divided by 10 is 819, a figure too large for the Error- 
  2327.       Level, so the ErrorLevel is set to the maximum value.
  2328.  
  2329.     2. Same assumption as 1.  GET KE reports
  2330.  
  2331.     GET KE
  2332.     The Environment is: 8190
  2333.     The ErrorLevel is: 81
  2334.  
  2335.     In this case the kb is divided by 100 and truncated by integer arithmetic 
  2336.       to 81.
  2337.  
  2338.     3. Same assumption as 1.  Suppose we want the free space in megabytes (mb) 
  2339.       on drive C:.
  2340.  
  2341.     GET K C /W1024
  2342.     The Environment is: 8190
  2343.     The ErrorLevel is: 7
  2344.  
  2345.     In this case, 8190 divided by 1024 is just under 8, but is truncated to 7 
  2346.       by the integer arithmetic used.  The BATch file is assured of at least 7 
  2347.       mb free.
  2348.  
  2349.     4. Obtain the free space on the diskette in drive B.  Assume that CHKDSK 
  2350.       reports 700,416 free.
  2351.  
  2352.     GET K b
  2353.     The Environment is: 684
  2354.     The ErrorLevel is: 68
  2355.     Rem Turn off GET reporting feature
  2356.     SET GET?=
  2357.  
  2358.     5.  There is no diskette in drive A:.  The error may be reported as 2 or 
  2359.       C.
  2360.  
  2361.     GET K A
  2362.     if not errorlevel 1 if not "%GET%"=="" goto DiskError
  2363.     Echo The free space on drive A: is %GET%
  2364.     goto exit
  2365.     :DiskError
  2366.     Echo Disk error %GET% on drive A:.
  2367.     :exit
  2368.  
  2369.  
  2370.   GET Q                    Get Disk Capacity (Quota)                   Page 47
  2371.  
  2372.     GET Q                                            Get Disk Capacity (Quota)
  2373.  
  2374.     Syntax: GET Q[E] [drive][/Wdiv] [/switches]
  2375.     Input:  drive letter and optionally divisor
  2376.             /switches - /M /V /W
  2377.     Output: ErrorLevel - KiloBytes/10, QE - KiloBytes/100
  2378.             Environment - KiloBytes
  2379.  
  2380.     Q reports the capacity of a disk.  GET Q works just like GET K except that 
  2381.       it returns the capacity of the disk as if it were empty. Q for Quota? 
  2382.       As with K, Q first determines that a formatted disk is present in the 
  2383.       drive.
  2384.  
  2385.     Q will most often be used to determine the type of diskette in a floppy 
  2386.       disk drive although it will work on a hard disk as well, if that is of 
  2387.       interest.  Before Q can make this determination, the disk must be 
  2388.       formatted, so it cannot be used to select the type of formatting to use 
  2389.       in a BATch file.
  2390.  
  2391.     For both Q and K the extended command divides the ErrorLevel by 100 but 
  2392.       does not change the Environment variable.  If you need a different 
  2393.       divisor for the ErrorLevel for K or Q, you can use the /W notation. This 
  2394.       divisor feature will be needed to get ErrorLevel information on large 
  2395.       partitions.
  2396.  
  2397.     EXAMPLES:
  2398.  
  2399.     1. A 360k diskette is in drive A:.  CHKDSK reports "362,496 bytes total 
  2400.       disk space".
  2401.  
  2402.     Rem Turn on GET reporting feature
  2403.     SET GET?=ON
  2404.     GET Q A
  2405.     The Environment is: 354
  2406.     The ErrorLevel is: 35
  2407.  
  2408.     That's right, in computer terms there are only 354kb on a nominal 360k 
  2409.       diskette after space is set aside for the boot record, FAT, and root 
  2410.       directory.  By the way, I think you will find that GET reports faster 
  2411.       than CHKDSK in spite of taking time to try the direct read to check for 
  2412.       drive ready.
  2413.  
  2414.     2. A 1.2mb diskette is in drive A:.  CHKDSK reports 1,213,952 total.
  2415.  
  2416.     GET QE A
  2417.     The Environment is: 1185
  2418.     The ErrorLevel is: 11
  2419.  
  2420.     3. A 720k diskette is in drive B:.  CHKDSK reports 730,416 bytes.
  2421.  
  2422.     GET Q b
  2423.     The Environment is: 713
  2424.     The ErrorLevel is: 71
  2425.  
  2426.     4. A 1.44mb disk is in drive B:.  CHKDSK reports 1,457,664 total bytes.
  2427.  
  2428.     GET Q B
  2429.     The Environment is: 1423
  2430.  
  2431.  
  2432.   Page 48                    Get Disk Capacity (Quota)                   GET Q
  2433.  
  2434.     The ErrorLevel is: 142
  2435.  
  2436.     5. CHKDSK reports 33,449,984 bytes total disk space on drive C:.  Use GET 
  2437.       to find the number of megabytes in the ErrorLevel.
  2438.  
  2439.     GET Q c /w1024
  2440.     The Environment is: 32666
  2441.     The ErrorLevel is: 31
  2442.     Rem Turn off GET reporting feature
  2443.     SET GET?=
  2444.  
  2445.     6.  There is no drive Z:.  The error may be reported as 1 or C.
  2446.  
  2447.     GET Q Z
  2448.     if not ErrorLevel 1 if not "%GET%"=="" goto DiskError
  2449.     Echo The disk in drive Z: has %GET% kilobyte capacity
  2450.     goto exit
  2451.     :DiskError
  2452.     if %GET%==1 Echo Invalid drive letter: Z.
  2453.     if %GET%==C Echo General failure on drive Z.
  2454.     :exit
  2455.  
  2456.  
  2457.   GET L                        Get volume label                        Page 49
  2458.  
  2459.     GET L                                                     Get volume label
  2460.  
  2461.     Syntax: GET L [drive]
  2462.     Input:  optional drive letter
  2463.             /switches - /M /V /U /L
  2464.     Output: ErrorLevel - 1=label found, 0=no label found
  2465.             Environment - Volume Label
  2466.  
  2467.     L gets the Volume Label of the specified disk.  The ErrorLevel is 0 if the 
  2468.       disk is not labelled, or 1 if the disk has a volume label.  The optional 
  2469.       argument is the drive letter, defaulting to the current drive.  If the 
  2470.       disk is not labelled, the GET variable will be expunged and the Error- 
  2471.       Level will be 0.
  2472.  
  2473.     Volume labels can be placed on disks when they are formatted by using the 
  2474.       /V switch with the FORMAT command, or later by using the DOS LABEL com- 
  2475.       mand, or other labelling utility.  Volume labels can be very useful in 
  2476.       identifying and cataloging diskettes, especially when they can be 
  2477.       checked automatically with a program such as GET.  Another use is to 
  2478.       verify that the user has inserted the correct diskette when running an 
  2479.       installation BATch program.
  2480.  
  2481.     Volume labels can be up to 11 characters.  DOS will allow any of the 256 
  2482.       ASCII and extended characters except ."/\[]:*|<>;,?, ASCII 0-31, and the 
  2483.       lower case alphabetic characters.  (Actually some LABEL programs allow 
  2484.       lower case and other characters such as the decimal point, but since DOS 
  2485.       converts lower case to caps and will not allow some characters it is 
  2486.       better to stick with caps and standard DOS labels.)  Even the space 
  2487.       character is allowable in a Volume label.  Therefore, with 184 charac- 
  2488.       ters to choose from, there is an almost endless set of combinations that 
  2489.       you can use.  To enter the extended characters above 127 hold down the 
  2490.       Alt key while typing the ASCII code on the number pad keys.  (On some 
  2491.       systems it is necessary to hold down both the Alt and the Shift keys 
  2492.       while typing an extended character.  You may be able to enter ASCII 127 
  2493.       with the Ctrl-BackSpace key.)  The file SCANCODE.DOC with the registered 
  2494.       version contains a table of all the ASCII characters.
  2495.  
  2496.     It is often convenient to have a space in a volume label, but most ver- 
  2497.       sions of DOS make it difficult to verify such a label with the BATch IF 
  2498.       subcommand.  To DOS the space is a delimiter, and the IF comparison will 
  2499.       fail, usually with some message such as "Bad command or file name".  To 
  2500.       work around this problem, GET provides a method to compare a string, 
  2501.       which may include one or more spaces, with the volume label of a disk by 
  2502.       using the LE command.  The test label is given in the argument and must 
  2503.       be enclosed in double quote characters.  The comparison is exact and 
  2504.       case sensitive, so get it right the first time.  If the string is less 
  2505.       than 11 characters long, do not include any trailing spaces to fill in 
  2506.       the 11 characters.  Only the characters up to the last non-space charac- 
  2507.       ter will be checked and additional spaces will cause the comparison to 
  2508.       fail.  If you need to test with the IF subcommand, the /U switch will 
  2509.       force lowercase letters (if any) to uppercase, and will convert spaces 
  2510.       to ASCII 255 characters.
  2511.  
  2512.     EXAMPLES:
  2513.  
  2514.     1. The disk in drive B: does not have a volume label.
  2515.  
  2516.     Rem Turn on GET reporting feature
  2517.  
  2518.  
  2519.   Page 50                        Get volume label                        GET L
  2520.  
  2521.     SET GET?=ON
  2522.     GET L B
  2523.     The ErrorLevel is: 0
  2524.  
  2525.     2. The disk in drive A: has the volume label BOB STEPHAN.
  2526.  
  2527.     GET L A
  2528.     The Environment is: BOB STEPHAN
  2529.     The ErrorLevel is: 1
  2530.  
  2531.     3. The disk in drive A: is not formatted.  The error may be reported as 
  2532.       'C' or one of the read error codes above.  Even though there is a value 
  2533.       in the environment, the ErrorLevel of 0 is sufficient to determine that 
  2534.       the disk does not have a volume label.
  2535.  
  2536.     GET L A
  2537.     if not errorlevel 1 goto NoLabel
  2538.     Echo The label on the disk in drive A: is %GET%
  2539.     goto exit
  2540.     :NoLabel
  2541.     if not "%GET%"=="" goto DiskError
  2542.     Echo There is no volume label on the disk in drive A:
  2543.     goto exit
  2544.     :DiskError
  2545.     Echo Error %GET% reading disk in drive A:
  2546.     :exit
  2547.  
  2548.  
  2549.   GET LE                       Match volume label                      Page 51
  2550.  
  2551.     GET LE                                                  Match volume label
  2552.  
  2553.     Syntax: GET LE "label" [drive]
  2554.     Input:  "label" for LE to match, optional drive letter
  2555.             /switches - /M /V /U /L
  2556.     Output: ErrorLevel - 1 =yes, 0=no
  2557.             Environment - Volume Label
  2558.  
  2559.     LE takes a trial label in the "label" argument and sets the ErrorLevel to 
  2560.       indicate whether the disk label matches.  The comparison is case sensi- 
  2561.       tive and there must not be any trailing blanks in the "label" argument. 
  2562.       The /U and /L switches affect only what is placed into the Enviroment 
  2563.       string and do not affect the comparison.
  2564.  
  2565.     EXAMPLES:
  2566.  
  2567.     1. Compare the volume label on the disk in drive A: with the string "BOB 
  2568.       STEPHAN"
  2569.  
  2570.     GET LE "BOB STEPHAN" A
  2571.     The Environment is: BOB STEPHAN
  2572.     The ErrorLevel is: 1
  2573.  
  2574.     2. Compare the volume label on the disk in drive A: with the string "BOB"
  2575.  
  2576.     GET LE "BOB" A
  2577.     The Environment is: BOB STEPHAN
  2578.     The ErrorLevel is: 0
  2579.     Rem Turn off GET reporting feature
  2580.     SET GET?=
  2581.  
  2582.  
  2583.  
  2584.  
  2585.   Page 52                          Get file size                         GET F
  2586.  
  2587.     GET F                                                Get file size (DIR=0)
  2588.  
  2589.     Syntax: GET F[E] filespec [/switches]
  2590.     Input: file specification including path but no wildcards.
  2591.            /switches /M /V /L /X /W /A
  2592.     Output: ErrorLevel - F: KiloBytes; FE: KiloBytes/10.
  2593.                        With /A: Bytes (up to 255).
  2594.             Environment - file size in KiloBytes, Bytes, or Hex bytes
  2595.  
  2596.     The file specification (filespec) is not in quotes and must not contain 
  2597.       wild card characters, but may contain drive and path information.
  2598.  
  2599.     F reports file size.  The result is reported as kilobytes which allows 
  2600.       sizes up to 261,120 bytes to be reported in the ErrorLevel.  For FE the 
  2601.       divisor is 10 so that files up to 2,611,200 bytes can be reported in the 
  2602.       ErrorLevel.  The /Wnum switch can be used to specify a divisor other 
  2603.       than 10 for either F or FE in the same manner as for GET K and GET Q. 
  2604.       The size in kilobytes will be divided by the divisor and the result 
  2605.       placed in the ErrorLevel.  These divisions affect the ErrorLevel only, 
  2606.       the value in the Environment will not be changed.  Values in the En- 
  2607.       vironment can be up to 655,530 kilobytes.  If it is possible to have 
  2608.       larger files on your system, the value for larger files will have an 
  2609.       asterisk as the last character indicating that the value is not valid, 
  2610.       but is larger than 655,530 kilobytes (671,262,720 bytes).
  2611.  
  2612.     If /A is specified, All the bytes in the file size will be reported in the 
  2613.       Environment for files up to 655,350 bytes.  If over that size, the value 
  2614.       will have an asterisk as the last character indicating that the size is 
  2615.       not valid, but that it is larger than 655,350 bytes. If the file is 255 
  2616.       bytes or less, the full size will be in the ErrorLevel.  The /Wdiv 
  2617.       switch can be used to specify a divisor for larger files so that the 
  2618.       resulting ErrorLevel will be less than 255.  The divisor does not affect 
  2619.       the Environment variable.
  2620.  
  2621.     The /X switch can be used to cause the exact file size to be reported in 
  2622.       the Environment in hexadecimal as was done in versions prior to 2.5.
  2623.  
  2624.     If the filespec cannot be found, the GET variable will be expunged from 
  2625.       the Environment and a standard DOS error code will be returned in the 
  2626.       ErrorLevel.  The error codes of special interest are:
  2627.          2 for "File not found"
  2628.          3 for "Path not found"
  2629.         15 for "Invalid drive"
  2630.  
  2631.     Directory existence:  The F command for GET Filesize can be used to 
  2632.       determine whether a named directory exists.  As usual, if the filespec 
  2633.       is a directory, the ErrorLevel will be 0 and the Environment variable 
  2634.       will be '0'.
  2635.  
  2636.     For example: GET F "d:\mydir\xxx" will return 2 if the path is found but 
  2637.       not the file named XXX, a 3 if the path D:\MYDIR is not found, or a 15 
  2638.       if there is no D: drive.  GET F "d:\mydir" will return either 2 or 15 
  2639.       since it is not clear whether MYDIR is supposed to be a file or a path. 
  2640.       Whenever the item specified in the filespec may not exist, always check 
  2641.       for an empty GET variable (IF "%GET%"=="") which indicates that an error 
  2642.       code is in the ErrorLevel.
  2643.  
  2644.  
  2645.  
  2646.   GET F                          Get file size                         Page 53
  2647.  
  2648.     NOTE: The use of GET F to test for the existence of a directory is valid 
  2649.       only for subdirectories, and not for a root directory.  Since DOS does 
  2650.       not recognize the root directory as a file, commands such as GET F \, 
  2651.       GET F c:\, GET F c:, etc. are not valid.  Also, although it is a docu- 
  2652.       mented procedure in MS DOS 5.0, do not use the NUL device to check for a 
  2653.       directory if any users might be using DR DOS 5.0.  DR DOS 5 thinks that 
  2654.       the NUL (and other) devices exist even in non-existent directories.  It 
  2655.       may be that a few other versions of DOS do not support the NUL device 
  2656.       method of checking, but GET will work with them all.
  2657.  
  2658.     Device Drivers: GET F can be used as a means of communication between your 
  2659.       CONFIG.SYS and your AUTOEXEC.BAT.  GET F will take the name of a device 
  2660.       driver that may have been loaded in CONFIG.SYS and check to see if it 
  2661.       has, in fact been loaded.  The response will be similar to that for a 
  2662.       DIR; i.e. if the driver is loaded, 0 in the ErrorLevel and "0" in the 
  2663.       Environment.  If the driver is not loaded, the Environment variable will 
  2664.       be empty, and the ErrorLevel will contain an error code, usually 2. 
  2665.       CAUTION!  The name you use for the driver must be the INTERNAL name, not 
  2666.       necessarily the same name you use in CONFIG.SYS.  Most memory mapping 
  2667.       commands and programs will show the internal name that you must use. 
  2668.       This method will not work for ANSI.SYS and its clones because they use 
  2669.       the name CON, but GET A is available to determine whether ANSI.SYS is 
  2670.       loaded.  (With all that said, it is only fair to point out that you can 
  2671.       accomplish the same effect with IF EXIST by using the internal name of 
  2672.       the device driver.)
  2673.  
  2674.     EXAMPLES:
  2675.  
  2676.     1. Check to see if the device QEMM is loaded.  The internal name for QEMM 
  2677.       is QEMM386$.  In this example, the driver is loaded.
  2678.  
  2679.     Rem Turn on GET reporting feature
  2680.     SET GET?=ON
  2681.     get F QEMM386$
  2682.     The Environment is: 0
  2683.     The ErrorLevel is: 0
  2684.  
  2685.     2. Same example, but QEMM is not loaded.
  2686.  
  2687.     get F QEMM386$
  2688.     The ErrorLevel is: 2
  2689.  
  2690.     3. Check for the existence of a directory named D:\QPRO\WQ1.  IN this ex- 
  2691.       ample the directory exists.
  2692.  
  2693.     GET F D:\QPRO\WQ1
  2694.     The Environment is: 0
  2695.     The ErrorLevel is: 0
  2696.  
  2697.     4. Same example, but the directory does not exist.  The ErrorLevel is 
  2698.       reported as 2 meaning "File not found" because it cannot be determined 
  2699.       of WQ1 is a file or a subdirectory.
  2700.  
  2701.     GET F D:\QPRO\WQ1
  2702.     The ErrorLevel is: 2
  2703.  
  2704.     5. Suppose a file named d:\qpro\wq1\taxes.wq1 is a valid file name.  Using 
  2705.       GET F to get the file size could produce any of the following results.
  2706.  
  2707.  
  2708.   Page 54                          Get file size                         GET F
  2709.  
  2710.  
  2711.     Rem If you enter an invalid directory:
  2712.     GET F D:\QPRO\WQ\TAXES.WQ1
  2713.     The ErrorLevel is: 3
  2714.  
  2715.     Rem If the file does not exist after all:
  2716.     GET F D:\QPRO\WQ1\TAXES.WQ1
  2717.     The ErrorLevel is: 2
  2718.  
  2719.     Rem If the file is found to have 23,129 bytes:
  2720.     GET F D:\QPRO\WQ1\TAXES.WQ1
  2721.     The Environment is: 23
  2722.     The ErrorLevel is: 23
  2723.     GET F D:\QPRO\WQ1\TAXES.WQ1 /X
  2724.     The Environment is: 5A59
  2725.     The ErrorLevel is: 23
  2726.     Rem Turn off GET reporting feature
  2727.     SET GET?=
  2728.  
  2729.     7. Suppose you have a file of exactly 166,816 bytes.  You could see the 
  2730.       following results.
  2731.  
  2732.     GET F filespec
  2733.     The Environment is: 163
  2734.     The ErrorLevel is: 163
  2735.  
  2736.     GET F filespec /A
  2737.     The Environment is: 166816
  2738.     The ErrorLevel is: 255
  2739.  
  2740.     GET F filespec /A /W1000
  2741.     The Environment is: 166816
  2742.     The ErrorLevel is: 166
  2743.  
  2744.     GET F filespec /A /W1000 /X
  2745.     The Environment is: 28BA0
  2746.     The ErrorLevel is: 166
  2747.  
  2748.  
  2749.     7. Suppose we have a file we want to copy to drive B:, but we want to 
  2750.       check if there is enough space for it.  Note that file size is rounded 
  2751.       up and disk space is truncated by integer arithmetic so the result here 
  2752.       will err on the safe side if at all.  Since GET F reports kilobytes in 
  2753.       the ErrorLevel, and GET K reports kilobytes in the Environment, we can 
  2754.       test as follows:
  2755.  
  2756.  
  2757.  
  2758.   GET F                          Get file size                         Page 55
  2759.  
  2760.     @echo off
  2761.     Rem First get the disk free space on drive B: and save it in FREE=
  2762.     get k b /VFREE=
  2763.     Rem Check for error
  2764.     if not errorlevel 1 goto error
  2765.     Rem Now get the size of the file and check if there is enough room.
  2766.     get f filename.ext
  2767.     Rem Check for error
  2768.     if "%GET%"=="" goto error
  2769.     Rem If the ErrorLevel is not greater than the free kilobytes goto sizeok.
  2770.     if not errorlevel %FREE% goto sizeok
  2771.     Echo There is insufficient space on Drive B: for filename.ext.
  2772.     goto exit
  2773.     :sizeok
  2774.     copy filename.exe b:
  2775.     goto exit
  2776.     :error
  2777.     Echo An error has occurred
  2778.     :exit
  2779.     Rem Clear out the FREE variable
  2780.     SET FREE=
  2781.  
  2782.  
  2783.   Page 56                        Current Directory                       GET Y
  2784.  
  2785.     GET Y                                                Get current directory
  2786.  
  2787.     Syntax: GET Y[E] [drive for Y] [/switches]
  2788.     Input:  optional drive letter for Y, none for YE
  2789.             /switches /M /V /L
  2790.     Output: ErrorLevel - Y: directory level, root=0; YE: current drive, A=0.
  2791.             Environment - directory path (Y) or drive letter (YE).
  2792.  
  2793.     Y  gets the current directory for the default or a specified drive.  It 
  2794.       takes an optional drive letter argument (the : is not necessary) which 
  2795.       defaults to the current drive if omitted.  The ErrorLevel reports the 
  2796.       directory level - 0 = root directory, 1 for first subdirectory level, 
  2797.       etc. Note that DOS maintains a "current directory" for each drive, not 
  2798.       just for the logged drive, so it makes sense to inquire about the cur- 
  2799.       rent directory on a drive other than the logged drive.
  2800.  
  2801.     YE returns the current (or logged) drive.  The drive letter is in the En- 
  2802.       vironment, and the drive number in the ErrorLevel - 0=A, 1=B, etc.
  2803.  
  2804.     EXAMPLES:
  2805.  
  2806.     1. Suppose the following conditions exist - logged drive is C:, current 
  2807.       directory on C: is C:\DOS, current directory on D: is D:\QPRO\WQ1, there 
  2808.       is no E: drive, a floppy disk with no subdirectories is in B:.  GET com- 
  2809.       mands will report as follows:
  2810.  
  2811.     Rem Turn on GET reporting feature
  2812.     SET GET?=ON
  2813.     GET Y
  2814.     The Environment is: \DOS
  2815.     The ErrorLevel is: 1
  2816.  
  2817.     GET Y D
  2818.     The Environment is: \QPRO\WQ1
  2819.     The ErrorLevel is: 2
  2820.  
  2821.     Rem Get the current drive and directory, and combine them to make
  2822.     Rem a full path that does not end in a trailing backslash.
  2823.     GET YE /VDIR=
  2824.     The Environment is: C
  2825.     The ErrorLevel is: 2
  2826.     GET Y
  2827.     The Environment is: \DOS
  2828.     The ErrorLevel is: 1
  2829.     if not ErrorLevel 1 set GET=
  2830.     SET DIR=%DIR%:%GET%
  2831.  
  2832.     GET Y B
  2833.     The Environment is: \
  2834.     The ErrorLevel is: 0
  2835.     Note: The root directory is the only case that GET ends the Environment
  2836.     variable with the \ character.  (It is easier to add one than to drop
  2837.     it off.)
  2838.  
  2839.     GET Y E
  2840.     The ErrorLevel is: 0
  2841.     Turn off GET reporting feature
  2842.     SET GET?=
  2843.  
  2844.  
  2845.   GET Y                        Current Directory                       Page 57
  2846.  
  2847.  
  2848.     2. You can "and" ErrorLevel checks together to check for a specific value. 
  2849.       In this example, use ErrorLevel to see if the current drive is B:.
  2850.  
  2851.     GET YE
  2852.     Rem if it is at least 1 and not 2 or more,
  2853.     Rem then it is exactly 1 meaning B:.
  2854.     if ErrorLevel 1 if not ErrorLevel 2 goto ISB
  2855.     Echo The current drive is not B:
  2856.     goto exit
  2857.     :ISB
  2858.     Echo The current drive is B:
  2859.     :exit
  2860.  
  2861.  
  2862.   Page 58               Get MEMORY and SYSTEM Information              GET.DOC
  2863.  
  2864.   GET MEMORY and SYSTEM Information
  2865.  
  2866.   The commands BR, P, E, M, D, 4, 7, and A obtain information about the opera- 
  2867.     ting system and hardware configuration.
  2868.  
  2869.     GET BR                                                  Get/Set Break Flag
  2870.  
  2871.     Syntax: GET BR [New flag] [/switches]
  2872.     Input: optional new flag - 1 = ON, 0 = OFF.
  2873.            /switches /M /V
  2874.     Output: ErrorLevel - old break flag
  2875.             Environment - old break flag
  2876.  
  2877.     GET BR checks and/or sets the DOS BREAK Flag. It works like some of the 
  2878.       other get/set commands such as B and V. GET BR will report 1 if the 
  2879.       BREAK Flag is ON, or 0 if it is OFF.  In addition, GET BR 1 will turn it 
  2880.       on, and GET BR 0 will turn it off.  Although you can control BREAK with 
  2881.       the DOS BREAK command, GET BR allows you to store the user setting and 
  2882.       temporarily change it to suit your programming style.  Of course, if you 
  2883.       allow the user to BREAK out of your BATch file with DOS Ctrl-Break hand- 
  2884.       ling, you will not have the opportunity to reset it, but if you want to 
  2885.       handle BREAK yourself and use /C regularly, then you can get, set, and 
  2886.       restore the user BREAK Flag with GET BR.
  2887.  
  2888.     GET BR also gives you another method of communicating information from 
  2889.       your CONFIG.SYS to your AUTOEXEC.BAT.  You can set BREAK ON or OFF in 
  2890.       CONFIG.SYS according to whatever you want it to mean, and use GET BR to 
  2891.       check and optionally reset it in your AUTOEXEC.BAT, then take some ac- 
  2892.       tion according to whether it was ON or OFF.
  2893.  
  2894.     EXAMPLES:
  2895.  
  2896.     1. Save user Break flag setting so you can turn it off to help you do your 
  2897.       own Ctrl-Break management with the /C switch.  When finished, restore 
  2898.       user's original flag setting.
  2899.  
  2900.     Rem set BREAK OFF and save old setting in variable BREAK=.
  2901.     GET BR 0 /VBREAK=
  2902.     Rem Now do whatever you want in the BATch file, such as:
  2903.     GET S "Enter your password: " /c
  2904.     Rem When finished, restore saved Break flag setting.
  2905.     GET BR %BREAK%
  2906.     Rem Don't forget to clear out the variable!
  2907.     SET BREAK=
  2908.  
  2909.     2.  Suppose in one CONFIG.SYS file you have BREAK=ON to indicate that you 
  2910.       are configuring for your CAD program, and in another CONFIG.SYS file you 
  2911.       have BREAK=OFF if you want to run your normal configuration.  In your 
  2912.       AUTOEXEC.BAT you can test the Break flag, set it to the setting you 
  2913.       want, and take appropriate action, thus using just one AUTOEXEC for both 
  2914.       configurations.
  2915.  
  2916.     Rem Get break flag setting and turn it off.
  2917.     GET BR 0
  2918.     if "%GET%"=="1" goto RUNCAD
  2919.     Rem Do your something else here.
  2920.     goto EXIT
  2921.     :RUNCAD
  2922.     Rem Run your CAD program here.
  2923.     :EXIT
  2924.  
  2925.  
  2926.   GET P                     Check for Printer(PRN)                     Page 59
  2927.  
  2928.     GET P                                               Check for printer(PRN)
  2929.  
  2930.     Syntax: GET P[E] [/switches]
  2931.     Input: none
  2932.            /switches /M /V
  2933.     Output: ErrorLevel - 1=yes, 0=no
  2934.             Environment - 1=yes, 0=no
  2935.  
  2936.     P checks whether a printer is available and ready at LPT1 (PRN).  1=yes, 
  2937.       0=no.
  2938.  
  2939.     PE will also send the DOS BIOS initialization signal to the printer as it 
  2940.       does during boot-up.  This may not work if a print buffer or spooler is 
  2941.       in use unless it can be bypassed.  If your printer has an internal buff- 
  2942.       er this is a way to flush it.  If PE reports no printer, then the print- 
  2943.       screen operation (the Print Screen or Shift PrtSc key) will be disabled 
  2944.       to prevent hanging the computer if the PrtSc key is inadvertently 
  2945.       pressed.  To enable print-screen again, run GET PE with a printer at- 
  2946.       tached and ready.
  2947.  
  2948.     EXAMPLES:
  2949.  
  2950.     1. Check to see if a printer is available.
  2951.  
  2952.     GET P
  2953.     if ErrorLevel 1 goto PRINTIT
  2954.     Echo Can't print, no printer available.
  2955.     goto EXIT
  2956.     :PRINTIT
  2957.     copy filename.ext prn
  2958.     :EXIT
  2959.  
  2960.     2. Initialize printer, clearing the buffer and setting the page setting to 
  2961.       Top of Form (TOF).  If no printer is available, the Print Screen func- 
  2962.       tion will be turned off.
  2963.  
  2964.     GET PE
  2965.     if ErrorLevel 1 goto PRINTIT
  2966.     Echo Can't print, no printer available.
  2967.     Echo The print screen function has been disabled.
  2968.     goto EXIT
  2969.     :PRINTIT
  2970.     Echo The printer has been initialized, internal buffer cleared.
  2971.     :EXIT
  2972.  
  2973.  
  2974.   Page 60                      Get Environment Left                      GET E
  2975.  
  2976.  
  2977.     GET E                                                 Get Environment Left
  2978.  
  2979.     Syntax: GET E[E] [/switches]
  2980.     Input: none
  2981.            /switches /M /V
  2982.     Output: ErrorLevel - number of Environment bytes free, EE divides by 10.
  2983.             Environment - number of Environment bytes free
  2984.  
  2985.     E reports the number of bytes of Environment space available.  If it might 
  2986.       be over 255 use EE which divides the number of bytes by 10 for the Er- 
  2987.       rorLevel only, and can report up to 2550 bytes. Since GET makes ex- 
  2988.       tensive use of the Environment, it is always a good idea to use GET E at 
  2989.       the beginning of the BATch file to determine whether there are enough 
  2990.       bytes available for the use of GET in the BATch file.
  2991.  
  2992.     EXAMPLES:
  2993.  
  2994.     1. Suppose GET will require at least 15 bytes of Environment space for the 
  2995.       variables it will create in your BATch file.  Remember to include the 
  2996.       space required by the variable name, the = sign, and a terminating zero 
  2997.       byte that is automatically added internally.
  2998.  
  2999.     GET E
  3000.     if ErrorLevel 15 goto CONTINUE
  3001.     Echo Not enough free Environment space to run this BATch file.
  3002.     goto EXIT
  3003.     :CONTINUE
  3004.     Rem Continue with the BATch file
  3005.     :EXIT
  3006.  
  3007.     2. A more primitive method of checking for environment space is to attempt 
  3008.       to create a variable then see if it is there.  This may result in the 
  3009.       user seeing an "Out of environment space" message.
  3010.  
  3011.     Rem Try to create a variable that will use 16 bytes of space.
  3012.     SET TEST=1234567890
  3013.     if "%TEST%"=="1234567890" goto CONTINUE
  3014.     Echo Not enough free Environment space to run this BATch file.
  3015.     goto EXIT
  3016.     :CONTINUE
  3017.     Rem Don't forget to clear out your test variable
  3018.     SET TEST=
  3019.     Rem Continue with the BATch file.
  3020.     :EXIT
  3021.  
  3022.  
  3023.  
  3024.  
  3025.  
  3026.   GET M                         Get Memory Free                        Page 61
  3027.  
  3028.     GET M                                                      Get Memory Free
  3029.  
  3030.     Syntax: GET M[E] [/switches]
  3031.     Input: none
  3032.            /switches /M /V
  3033.     Output: ErrorLevel - number of kilobytes free, ME divides by 10.
  3034.             Environment - number of kilobytes free
  3035.  
  3036.     M  reports the free memory available in kilobytes.  ME divides by 10.
  3037.  
  3038.     EXAMPLES:
  3039.  
  3040.     1.   A BATch file can check if there is sufficient memory to run a pro- 
  3041.       gram.
  3042.  
  3043.     GET M
  3044.     if errorlevel 150 goto CONTINUE
  3045.     Echo Not enough memory to run your program.
  3046.     goto EXIT
  3047.     :CONTINUE
  3048.     Rem Run your program here.
  3049.     :EXIT
  3050.  
  3051.     2.  Suppose your program requires 300kb of memory.
  3052.  
  3053.     GET ME
  3054.     if errorlevel 30 goto CONTINUE
  3055.     Echo Not enough memory to run your program.
  3056.     goto EXIT
  3057.     :CONTINUE
  3058.     Rem Run your program here.
  3059.     :EXIT
  3060.  
  3061.  
  3062.   Page 62                         Get DOS Version                        GET D
  3063.  
  3064.     GET D                                                      Get DOS Version
  3065.  
  3066.     Syntax: GET D[E] [/switches]
  3067.     Input: none
  3068.            /switches /M /V
  3069.     Output: ErrorLevel - First two digits of DOS Version times 10.
  3070.             Environment - Major Version, DE gives Minor Version.
  3071.  
  3072.     D  reports the DOS version.  The ErrorLevel will contain a number such as 
  3073.       33 for DOS 3.3 and 3.31, or 50 for DOS 5.0.  The Environment will con- 
  3074.       tain the major version such as 3 for DOS 3.0, 3.1, 3.3, or 3.3.  DE will 
  3075.       report the minor version in the Environment such as 1 for DOS 3.1 or 0 
  3076.       for DOS 5.0.
  3077.  
  3078.     EXAMPLES:
  3079.  
  3080.     1. You're setting up a program for your clients and it requires something 
  3081.       different depending on whether the DOS Version is later than or earlier 
  3082.       than 3.1.
  3083.  
  3084.     GET D
  3085.     if ErrorLevel 31 goto DOS3
  3086.     Rem Do what you need here for DOS 2.x or 3.0.
  3087.     goto EXIT
  3088.     :DOS3
  3089.     Rem Do what you need here for DOS 3.1 and later.
  3090.     :EXIT
  3091.  
  3092.     2. You are distributing a program that requires DOS 3.3 or later.
  3093.  
  3094.     GET D
  3095.     if ErrorLevel 33 goto DOSOK
  3096.     Echo This program requires DOS 3.3 or later.
  3097.     goto EXIT
  3098.     :DOSOK
  3099.     Rem Run your program here.
  3100.     :EXIT
  3101.  
  3102.  
  3103.  
  3104.   GET 7                        Check Coprocessor                       Page 63
  3105.  
  3106.     GET 7                                                Check Coprocessor/CPU
  3107.  
  3108.     Syntax: GET 7[E] [/switches]
  3109.     Input: none
  3110.            /switches /M /V
  3111.     Output: ErrorLevel - 7: Math Coprocessor Installed - 7E: type of CPU.
  3112.             Environment - Character representation of ErrorLevel number.
  3113.  
  3114.     7  reports whether a math coprocessor is installed.  1=yes, 0=no.
  3115.  
  3116.     7E reports the CPU chip type - 0 for 8088/86, 2 for 80286, or 3 for 80386 
  3117.       or later.
  3118.  
  3119.     EXAMPLES:
  3120.  
  3121.     1. Run a faster version of a mathematical program if a coprocessor is in- 
  3122.       stalled.
  3123.  
  3124.     GET 7
  3125.     if ErrorLevel 1 goto NDP
  3126.     Rem Run the slower version here
  3127.     goto EXIT
  3128.     :NDP
  3129.     Rem Run the faster version here
  3130.     :EXIT
  3131.  
  3132.     2. Run the 386 version of a program if the CPU is an 80386 or later.
  3133.  
  3134.     GET 7E
  3135.     if ErrorLevel 3 goto IS386
  3136.     Rem Run the non-386 version here
  3137.     goto EXIT
  3138.     :IS386
  3139.     Rem Run the 386 version here
  3140.     :EXIT
  3141.  
  3142.  
  3143.   Page 64                       Check 4DOS/Windows                       GET 4
  3144.  
  3145.     GET 4                                                   Check 4DOS/Windows
  3146.  
  3147.     Syntax: GET 4[E] [/switches]
  3148.     Input: none
  3149.            /switches /M /V
  3150.     Output: ErrorLevel - 4: 4DOS - 7E: Windows.
  3151.             Environment - Character representation of ErrorLevel number.
  3152.  
  3153.     4 Checks whether 4DOS or [4E] Windows is currently running. 1=yes, 0=no. 
  3154.       Some DOS commands, such as CHKDSK, must not be run if Windows is run- 
  3155.       ning.  You can use this command to avoid these problems.
  3156.  
  3157.       4DOS provides a method to make this check directly with BATch commands. 
  3158.       It may be a convenience to use GET to get and store the information in 
  3159.       the same command.  4DOS provides a lot of services for BATch files, and 
  3160.       some DOS-like commands have extra features, but if the BATch file might 
  3161.       be run on a system that is not using 4DOS for the command processor 
  3162.       those extra features can't be used.
  3163.  
  3164.     EXAMPLES:
  3165.  
  3166.     1. If 4DOS is the command processor, use some of its special features.  If 
  3167.       not, make do the best you can with COMMAND.COM and GET.
  3168.  
  3169.     Rem Find out if 4DOS is running and store the information.
  3170.     GET 4 /V4DOS=
  3171.     if "%4DOS%"=="0" goto to MSDOS
  3172.     Rem Run your 4DOS enhanced commands here.
  3173.     goto EXIT
  3174.     :MSDOS
  3175.     Rem Do the best you can with MS DOS and GET here.
  3176.     :EXIT
  3177.     Rem Clear out the 4DOS variable
  3178.     SET 4DOS=
  3179.  
  3180.     2. Make a cover for CHKDSK to avoid damaging your disk if Windows is run- 
  3181.       ning.  Since CHKDSK is an external command, you can rename it to some- 
  3182.       thing else to avoid running it inadvertently.  Suppose we rename it 
  3183.       CHEKDISK.EXE and call this BATch file CHKDSK.BAT.
  3184.  
  3185.     @Echo off
  3186.     Rem This file is CHKDSK.BAT, a cover for DOS CHKDSK.
  3187.     get 4E
  3188.     if ErrorLevel 1 goto WINDOWS
  3189.     CHEKDISK %1 %2 %3
  3190.     goto EXIT
  3191.     :WINDOWS
  3192.     Echo Don't run CHKDSK when WINDOWS is running!
  3193.     :EXIT
  3194.  
  3195.  
  3196.  
  3197.   GET A                    Check for ANSI.SYS/Model                    Page 65
  3198.  
  3199.     GET A                                             Check for ANSI.SYS/Model
  3200.  
  3201.     Syntax: GET A[E] [/switches]
  3202.     Input: none
  3203.            /switches /M /V
  3204.     Output: ErrorLevel - A: ANSI.SYS - AE: ROM BIOS Model Byte
  3205.             Environment - A: 1=yes, 0=no - AE: Hexadecimal Model Byte
  3206.  
  3207.     A  reports whether ANSI.SYS is loaded.  If you are using an ANSI.SYS 
  3208.       clone, check to see if it works with yours.
  3209.  
  3210.     AE will return the ROM BIOS model byte.  At this time the documented model 
  3211.       bytes listed in "The NEW Peter Norton's Programmer's Guide to the IBM PC 
  3212.       and PS/2," (Page 64) are:
  3213.  
  3214.           FF(255)=PC(1981)
  3215.         FE(254)=PC or PC/XT(1982)
  3216.         FD(253)=PCjr(1983)
  3217.           FC(252)=PC/AT(1984-85),PC/XT Model 286(1986),PS/2 Model 50/60(1987)
  3218.           FB(251)=PC/XT(1986)
  3219.         FA(250)=PS/2 Model 25(1987)/30(1986)
  3220.           F9(249)=PC Convertible
  3221.         F8(248)=PS/2 Model 80(1987)
  3222.           (Example: My 80386 AT clone is an FC).
  3223.  
  3224.     EXAMPLES:
  3225.  
  3226.     1.  If the computer is running ANSI.SYS you can use it to provide special 
  3227.       screen effects.  For example, 4DOS has commands that take advantage of 
  3228.       the features of ANSI.SYS that won't work if ANSI.SYS isn't loaded.
  3229.  
  3230.     Rem Check for ANSI.SYS and store the result in ANSI=
  3231.     GET A /VANSI=
  3232.  
  3233.     2.  If you are supporting several computers and they are different models, 
  3234.       you may be able to determine which one is running the BATch file by 
  3235.       reading the model byte.
  3236.  
  3237.     GET AE
  3238.     if "%GET%"=="FC" goto ATCLONE
  3239.     if "%GET%"=="F9" goto CONVERT
  3240.     if "%GET%"=="FD" goto PCJR
  3241.     Rem Do things for other computers here
  3242.     goto EXIT
  3243.     :ATCLONE
  3244.     Rem Do things for AT Clone here
  3245.     goto EXIT
  3246.     :CONVERT
  3247.     Rem Do things for IBM Convertible here
  3248.     goto EXIT
  3249.     :PCJR
  3250.     Rem Do things for the PC Jr. here
  3251.     :EXIT
  3252.  
  3253.  
  3254.   Page 66                         Warm/Cold Boot                         GET W
  3255.  
  3256.     GET W                                                       Warm/Cold Boot
  3257.  
  3258.     Syntax: GET W[E] [arg] [/switches]
  3259.     Input: any argument to just report type of last boot.
  3260.            /switches /M /V
  3261.     Output: ErrorLevel - If arg, 1=warm, 0=cold
  3262.             Environment - If arg, 1=warm, 0=cold
  3263.  
  3264.     W  will reboot the computer as if the 3-finger salute (Ctrl-Alt-Del) was 
  3265.       pressed unless an arg is given.
  3266.  
  3267.     WE will reboot as if the computer was turned off then on again unless an 
  3268.       argument is given.
  3269.  
  3270.     If any characters are present as an argument with W or WE, GET will at- 
  3271.       tempt to determine if the preceding boot was warm or cold instead of 
  3272.       rebooting.  This does not work on all machines.  It depends on whether 
  3273.       the booting procedure clears a certain memory location - it worked on my 
  3274.       XT but not on my 386, for example.  If successful, a 1 indicates the 
  3275.       previous boot was warm, 0 means it was a cold boot.
  3276.  
  3277.     EXAMPLES
  3278.  
  3279.     1. Copy in a new AUTOEXEC.BAT and CONFIG.SYS and warm boot.
  3280.  
  3281.     copy autoexec.new autoexec.bat
  3282.     copy config.new config.sys
  3283.     get w
  3284.  
  3285.     2. Ask for a password, if it is wrong cold boot the computer.
  3286.  
  3287.     get S "Enter password now: " TTTTTTTT
  3288.     if "%GET%"=="PASSWORD" goto OK
  3289.     get we
  3290.     OK:
  3291.     Rem Password was correct, continue.
  3292.  
  3293.     3. Perform a CHKDSK if a cold boot but not a warm boot - may only work on 
  3294.       XT class machines.
  3295.  
  3296.     GET W xxx
  3297.     if ErrorLevel 1 CHKDSK
  3298.  
  3299.  
  3300.   GET.DOC                  The Environment and Shells                  Page 67
  3301.  
  3302.   Environment and Shells
  3303.  
  3304.   This is a brief, general discussion of the DOS Environment for those who may 
  3305.     not be sufficiently familiar with it.  For a more extensive discussion of 
  3306.     the Environment, see Appendix A in the printed documentation provided with 
  3307.     the registered version.
  3308.  
  3309.      The DOS Environment is a small area (usually) of memory that DOS automat- 
  3310.     ically allocates to every program that it is asked to load or run.  The 
  3311.     "master" Environment is the original Environment allocated to COMMAND.COM 
  3312.     or 4DOS or whichever command processor you are using.  The original size 
  3313.     of the Environment can be set in later versions of DOS by using the SHELL 
  3314.     command in your CONFIG.SYS file.  However, the setting of Environment size 
  3315.     is not a SHELL command function, but is a command processor option.  For 
  3316.     example, the COMMAND.COM /E: switch lets you set the size if you are using 
  3317.     COMMAND.COM as your command processor.  For documentation look under such 
  3318.     topics as SHELL, COMMAND, and "Configuring Your System" in your DOS 
  3319.     manual.  Since most new programs make extensive use of the Environment, it 
  3320.     is important to be sure enough Environment space is allocated to accom- 
  3321.     modate them all.  If you see the error message "Out of Environment Space", 
  3322.     you know that you do not have enough allocated.
  3323.  
  3324.      You can view the contents of the Environment by issuing the SET command 
  3325.     of DOS with no arguments at the DOS prompt.  You will see a sequence of 
  3326.     variable names, each followed by the "=" sign and the string value as- 
  3327.     signed to the variable.  For example, COMSPEC=C:\COMMAND.COM.  You can 
  3328.     also store string information in the Environment with the SET command by 
  3329.     specifying it in the same manner as it is displayed.  For example, SET 
  3330.     PATH=C:\;C:\DOS.  Do not place any spaces on either side of the "=" sign 
  3331.     unless you intend for the space to be either a part of the variable name 
  3332.     or a part of the string.  When DOS loads and runs a COM or EXE program 
  3333.     file, that program receives a copy of the Environment as it is at that 
  3334.     time, trimmed down so that only a few bytes remain free.  This copy does 
  3335.     not change unless the program that owns it changes it.
  3336.  
  3337.      Note that some DOS "shells" shield the master Environment from programs 
  3338.     that are executed by the shell. If you find that to be the case, the in- 
  3339.     formation will usually be available to the BATch file from the Environment 
  3340.     of the secondary command processor loaded by the shell as is usually 
  3341.     necessary to run a BATch file.  Except for the /M switch, GET only at- 
  3342.     tempts to locate the Environment of the command processor that is running 
  3343.     the BATch file, so the Environment information can disappear if the shell 
  3344.     or the secondary command processor is terminated.  GET attempts to place 
  3345.     the information where the BATch file can locate it since that is its pri- 
  3346.     mary purpose.  Also, when running from a shell there may be problems with 
  3347.     "Out of Environment space" since DOS does not usually allocate excess En- 
  3348.     vironment space to child processes.  4DOS provides a means to ensure that 
  3349.     copies of the Environment have sufficient space available.  Check the doc- 
  3350.     umentation for your shell program to see if it can make sufficient En- 
  3351.     vironment space available.  You can always ensure that GET has enough En- 
  3352.     vironment space to store its results by establishing a dummy GET variable 
  3353.     before loading any shells or other programs.  The best way would be to do 
  3354.     it in your AUTOEXEC.BAT.  Simply insert the command SET GET=xxxxx...xxxx 
  3355.     in your AUTOEXEC.BAT file with enough x's or other characters for the max- 
  3356.     imum length input string you are expecting.
  3357.  
  3358.  
  3359.   Page 68                      Program Information                     GET.DOC
  3360.  
  3361.   PROGRAM INFORMATION
  3362.  
  3363.     GET is programmed in assembly language for MS-DOS computers. It was as- 
  3364.     sembled with Borland's Turbo Assembler, and compressed with a file com- 
  3365.     pression utility. GET is designed to be small and fast to provide rapid 
  3366.     response in BATch files and not take up too much room on floppy disks, 
  3367.     consequently it does not do extensive error checking.  Nothing in GET is 
  3368.     known to cause harm, but if parameters are not used in accordance with the 
  3369.     documentation the results may not be what you expect.  GET is designed for 
  3370.     productive use by BATch programmers, not for casual use from the keyboard.
  3371.  
  3372.     In most applications there will be no noticeable slowing down of BATch 
  3373.     file execution due to the use of GET.  Most versions of DOS read and ex- 
  3374.     ecute lines of BATch files one at a time.  This is the slowest part of the 
  3375.     BATch execution process.  Providing there are sufficient DOS buffers or a 
  3376.     disk cache, GET will remain available in the buffers or cache in memory 
  3377.     and execute instantaneously when loaded by DOS.  Some additional speedup 
  3378.     may be noticed if it is possible to locate GET.EXE and/or your BATch file 
  3379.     on a virtual disk in RAM such as on a RAMDRIVE or VDISK.
  3380.  
  3381.     Some of the code for GET was adapted from the sample program named 
  3382.     WHAT.ASM included with Microsoft Macro Assembler (MASM).  The MASM docu- 
  3383.     mentation declares that the sample programs are in the public domain. For 
  3384.     examples of GET, look at the BATch files on the MASDIR disk mentioned be- 
  3385.     low for the use of a similar program called SDL_GET.  You can do a lot in 
  3386.     BATch programming with this utility.
  3387.  
  3388.   LICENSING AND DISTRIBUTION
  3389.  
  3390.     Although this version of GET remains free for personal use for all to en- 
  3391.     joy, if you like GET and would like to help support development of in- 
  3392.     expensive software, please send a contribution to the address below. 
  3393.     Thank you for any support you care to provide.  If you send $15 or more 
  3394.     (overseas $20 U.S. funds) you will receive the following benefits:
  3395.       The latest version of GET with any new features plus one free upgrade.
  3396.       A smaller runtime version to distribute with your BATch files.
  3397.       A single user license with no royalties for use of the runtime version.
  3398.       A >60 page user manual giving examples and more detailed explanations.
  3399.       Free support by BBS, mail, phone, CompuServe, or Genie (see below).
  3400.       Notification of new releases and upgrades after the first one.
  3401.     California residents please add 7.75% sales tax.  See the SPECIAL OFFER 
  3402.     below for a discount on registering both GET and MASDIR.
  3403.  
  3404.   If you have a modem, VISA and MASTERCARD registrations can be entered via 
  3405.     NITELOG BBS, 408-655-1096.  After completing the brief sign-on registra- 
  3406.     tion, enter S for Script, then 3 for Script 3 and provide the requested 
  3407.     information.
  3408.  
  3409.     If you like and use GET but can't send money, at least drop me a note and 
  3410.     I'll put you on my list to receive new "freeware" releases as they become 
  3411.     available.  Your help in distributing new releases of GET will be ap- 
  3412.     preciated.
  3413.  
  3414.     CORPORATE users must obtain a site license from me for in-house use.  If 
  3415.     GET is to be installed on 2 machines $25, 3 machines $35, plus $5 for each 
  3416.     additional machine.   None of the above licensing terms includes using GET 
  3417.     in conjunction with the distribution of a commercial (retail) software 
  3418.     product other than shareware, user-supported, or public domain software.  
  3419.  
  3420.  
  3421.   GET.DOC                      Program Information                     Page 69
  3422.  
  3423.     To use GET in conjunction with the distribution of a retail software pro- 
  3424.     duct you must contact me to discuss terms.  Licenses are available for up 
  3425.     to 50 copies for $100, up to 500 copies for $200, unlimited copies for 
  3426.     $500.  Call or message me for quotes if you are interested.
  3427.  
  3428.     BBS SYSOPs, PC User Groups, and shareware authors and distributors are 
  3429.     hereby granted a single user license to use GET for their own purposes and 
  3430.     to freely distribute unmodified copies of this version of GET.EXE and the 
  3431.     associated files in GET25.ZIP.  If an unregistered version of GET is used 
  3432.     in conjunction with the distribution of a shareware or public domain soft- 
  3433.     ware product, the distribution disk must include GET25.ZIP.
  3434.  
  3435.     VENDORS who have my permission to distribute my shareware product MASDIR, 
  3436.     also have my permission to distribute GET.  Other vendors must contact me 
  3437.     for permission by sending me a request accompanied with a current catalog 
  3438.     or other list of offerings.
  3439.  
  3440.     REGISTERED users of GET may use and distribute GET in accordance with 
  3441.     these rules.  GETRUN.EXE is a runtime version of GET available only to 
  3442.     registered users.  It omits the online help screens and the debugging in- 
  3443.     formation so is considerably smaller - under 4k compressed file size - and 
  3444.     runs in less than 9k of memory.  GET is not a TSR so the memory is in use 
  3445.     only while GET is actually running.
  3446.  
  3447.     1. GET.EXE may be freely distributed provided the distribution disk in- 
  3448.     cludes all *.DOC and other GET distribution files.  Such distribution must 
  3449.     not include GETRUN.EXE under any name.
  3450.  
  3451.     2. If you are a licensed user of GETRUN.EXE, up to the licensed number of 
  3452.     copies of GETRUN.EXE may be renamed GET.EXE and used in conjunction with 
  3453.     distributed BATch files, provided that neither GET.DOC nor GET25NEW.DOC 
  3454.     are included on any disk in the distribution package.  For non-commercial 
  3455.     use, licensed users may use an unlimited number of copies.
  3456.  
  3457.     3. GET.EXE must never be included in any distribution that includes 
  3458.     GETRUN.EXE no matter what names are used for these files.
  3459.  
  3460.     If you have any questions, comments, or suggestions please contact me at:
  3461.         MOBY DISK: 1021 San Carlos Road, Pebble Beach, CA 93953
  3462.     Phone: (408) 646-1899/1373.    GENIE:MOBYDISK.      COMPUSERVE:72357,2276
  3463.     BBS: The Cricket 408-373-3773        /s/ Bob Stephan    November 29, 1991
  3464.  
  3465.     Now for the commercial
  3466.  
  3467.     If you like GET please try MASDIR!  MASDIR (pronounced 'master') the 
  3468.     MASter DIRectory System, is a general purpose sorted directory program 
  3469.     with unique customization and disk label printing features. If you ever 
  3470.     use DIR, you should do yourself a favor and take a look at MASDIR. MASDIR 
  3471.     is not a "shell"!  The main program, SDL.COM, is one of the best sorted 
  3472.     directory programs anywhere. The setup program allows you to set the many 
  3473.     defaults to your own specifications, including customizing the titles that 
  3474.     appear in the header. In addition, you can print disk labels and/or sleeve 
  3475.     inserts for 5.25" and 3.5" diskettes. This really saves you a lot of time 
  3476.     when you are looking through your collection of diskettes for a particular 
  3477.     file. They are all listed conveniently along with your own description in 
  3478.     the title lines. You can also create disk file catalogs of your diskettes 
  3479.     and directories that you can then annotate to describe individual files, 
  3480.     and search with your editor or listing program.
  3481.  
  3482.  
  3483.   Page 70              MASDIR, The MASter DIRectory System             GET.DOC
  3484.  
  3485.  
  3486.     Additional features include listing only subdirectories or not listing 
  3487.     them at all, listing only files created today or within a specified peri- 
  3488.     od, reverse sorting for any of the sort options, the amount of space a 
  3489.     group of files will occupy for different cluster sizes, support for DR DOS 
  3490.     and 4DOS, SETting defaults in the Environment, enter two file specifica- 
  3491.     tions such as *.COM *.EXE, paging up and down in large directories, show 
  3492.     only files that have not been backed up (archive bit set), and many more.
  3493.  
  3494.     As of the above date, the current release of MASDIR is Version 5.4. It is 
  3495.     a shareware program that is available on bulletin boards, GENIE, Com- 
  3496.     puServe, The Public (software) Library, PC-SIG, and from other distrib- 
  3497.     utors of public domain and shareware programs. If you cannot conveniently 
  3498.     locate a copy, I will be happy to send you one. Just contact me as indi- 
  3499.     cated above. The registration fee for MASDIR is $19 including shipping and 
  3500.     handling for the program, plus one unit of labels free.  Please include $2 
  3501.     S&H only if you order any amount of labels.
  3502.  
  3503.     SPECIAL OFFER.  Register both GET and MASDIR and take a 15% discount.  Use 
  3504.     the MASDIR order form and indicate that you want both MASDIR 5.4 and GET 
  3505.     2.5 for just $29, instead of MASDIR by itself for $19.  Then complete the 
  3506.     rest of the form for any other items you want.
  3507.  
  3508.   If you have a modem, VISA or MASTERCARD registrations can be entered via 
  3509.     NITELOG BBS, 408-655-1096.  After completing the brief sign-on registra- 
  3510.     tion, enter S for Script, then 3 for Script 3.
  3511.  
  3512.     Thank you for your kind attention.                /Bob/  November 29, 1991
  3513.  
  3514.  
  3515.                                    Appendix A
  3516.  
  3517.                               The DOS Environment
  3518.  
  3519.                Available in the manual for the registered version
  3520.  
  3521.  
  3522.                                    Appendix B
  3523.  
  3524.                               ASCII and Scan Codes
  3525.  
  3526.                Available in the manual for the registered version
  3527.